file_path
stringlengths
10
10
code
stringlengths
79
330k
code_en
stringlengths
79
330k
language
stringclasses
1 value
license
stringclasses
0 values
token_count
int32
24
158k
0000921.py
from sqlalchemy.testing import assert_raises, eq_ from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import ( testing, exc, case, select, literal_column, text, and_, Integer, cast, String, Column, Table, MetaData) from sqlalchemy.sql import table, column info_table = None class CaseT...
from sqlalchemy.testing import assert_raises, eq_ from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import ( testing, exc, case, select, literal_column, text, and_, Integer, cast, String, Column, Table, MetaData) from sqlalchemy.sql import table, column info_table = None class CaseT...
en
null
1,845
0013686.py
"""Tests for chebyshev module. """ import numpy as np import numpy.polynomial.chebyshev as ch from numpy.testing import * def trim(x) : return ch.chebtrim(x, tol=1e-6) T0 = [ 1] T1 = [ 0, 1] T2 = [-1, 0, 2] T3 = [ 0, -3, 0, 4] T4 = [ 1, 0, -8, 0, 8] T5 = [ 0, 5, 0, -20, 0, 16] T6 = [-1,...
"""Tests for chebyshev module. """ import numpy as np import numpy.polynomial.chebyshev as ch from numpy.testing import * def trim(x) : return ch.chebtrim(x, tol=1e-6) T0 = [ 1] T1 = [ 0, 1] T2 = [-1, 0, 2] T3 = [ 0, -3, 0, 4] T4 = [ 1, 0, -8, 0, 8] T5 = [ 0, 5, 0, -20, 0, 16] T6 = [-1,...
en
null
7,584
0001518.py
import os import aiofiles import webbrowser import json as stdlib_json from sanic import Sanic, response from sanic.exceptions import abort from sanic.response import json from pyfy import AsyncSpotify, ClientCreds, AuthError try: from spt_keys import KEYS except: # noqa: E722 from spt_keys_template import ...
import os import aiofiles import webbrowser import json as stdlib_json from sanic import Sanic, response from sanic.exceptions import abort from sanic.response import json from pyfy import AsyncSpotify, ClientCreds, AuthError try: from spt_keys import KEYS except: # noqa: E722 from spt_keys_template import ...
en
null
1,040
0039303.py
import sys # from visualize.visual import * import h5py import json import random import cv2 import numpy as np import os from skimage.transform import resize from skimage.filters import gaussian import matplotlib.pyplot as plt from scipy import misc font=cv2.FONT_HERSHEY_SIMPLEX false_results_dir = "vqa-mfb/mfb_coat...
import sys # from visualize.visual import * import h5py import json import random import cv2 import numpy as np import os from skimage.transform import resize from skimage.filters import gaussian import matplotlib.pyplot as plt from scipy import misc font=cv2.FONT_HERSHEY_SIMPLEX false_results_dir = "vqa-mfb/mfb_coat...
en
null
2,247
0037166.py
#!/usr/bin/env python3 """This script provides a RESTful remote endpoint to the detection pipeline. An image is sent to the server, which sends back the requested results. """ import inspect import io import json from tempfile import NamedTemporaryFile from urllib import parse import cachetools import msgpack import ...
#!/usr/bin/env python3 """This script provides a RESTful remote endpoint to the detection pipeline. An image is sent to the server, which sends back the requested results. """ import inspect import io import json from tempfile import NamedTemporaryFile from urllib import parse import cachetools import msgpack import ...
en
null
2,366
0003380.py
from typing import Callable, Optional import gin import gym from interact.agents.ddpg.ddpg import DDPGAgent from interact.agents.utils import register @gin.configurable(name_or_fn="td3", denylist=["env_fn"]) @register("td3") class TD3Agent(DDPGAgent): """The Twin Delayed DDPG (TD3) algorithm. This algorith...
from typing import Callable, Optional import gin import gym from interact.agents.ddpg.ddpg import DDPGAgent from interact.agents.utils import register @gin.configurable(name_or_fn="td3", denylist=["env_fn"]) @register("td3") class TD3Agent(DDPGAgent): """The Twin Delayed DDPG (TD3) algorithm. This algorith...
en
null
1,471
0020966.py
import torch import numpy as np import torch.nn.functional as F from ..src.Conv1DT_6 import Conv1DT as NumpyConv1DT class Tester: conv1dt_numpy = NumpyConv1DT() def y_torch(self, x, weight, bias, stride, padding): x = torch.tensor(x) weight = torch.tensor(weight) bias = torch.tensor(b...
import torch import numpy as np import torch.nn.functional as F from ..src.Conv1DT_6 import Conv1DT as NumpyConv1DT class Tester: conv1dt_numpy = NumpyConv1DT() def y_torch(self, x, weight, bias, stride, padding): x = torch.tensor(x) weight = torch.tensor(weight) bias = torch.tensor(b...
en
null
954
0007469.py
# -*- coding: UTF-8 -*- from django.test import Client, TestCase from django.contrib.auth.models import Group from django.core.cache import cache from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.utils import simplejson from privilege.core.config import GROUP_...
# -*- coding: UTF-8 -*- from django.test import Client, TestCase from django.contrib.auth.models import Group from django.core.cache import cache from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.utils import simplejson from privilege.core.config import GROUP_...
en
null
2,805
0010457.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # import argparse import os import sys from rdkit import Chem from rdkit.six import StringIO from meeko import PDBQTMolecule def cmd_lineparser(): parser = argparse.ArgumentParser(description='Copy atom coordinates from PDBQT (or DLG) file \ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # import argparse import os import sys from rdkit import Chem from rdkit.six import StringIO from meeko import PDBQTMolecule def cmd_lineparser(): parser = argparse.ArgumentParser(description='Copy atom coordinates from PDBQT (or DLG) file \ ...
en
null
1,106
0032044.py
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils import timezone import datetime # Create your models here. class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.Da...
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils import timezone import datetime # Create your models here. class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.Da...
en
null
227
0049228.py
# Copyright (C) 2004-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Aric Hagberg <aric.hagberg@gmail.com> # Pieter Swart <swart@lanl.gov> # Sasha Gutfraind <ag362@corne...
# Copyright (C) 2004-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Aric Hagberg <aric.hagberg@gmail.com> # Pieter Swart <swart@lanl.gov> # Sasha Gutfraind <ag362@corne...
en
null
3,014
0030304.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
en
null
6,027
0026848.py
#!/usr/bin/env python3 # author: github.com/olehermanse # import libraries used for plotting and mathematical operations: import numpy as np import matplotlib.pyplot as plt # Define a mathematical expression as a function: def f(x): return x**3 x = np.linspace(-3, 3, 100) # Make array of 100 values between -2 an...
#!/usr/bin/env python3 # author: github.com/olehermanse # import libraries used for plotting and mathematical operations: import numpy as np import matplotlib.pyplot as plt # Define a mathematical expression as a function: def f(x): return x**3 x = np.linspace(-3, 3, 100) # Make array of 100 values between -2 an...
en
null
136
0048920.py
import typing as tp import jax import jax.numpy as jnp import numpy as np import treeo as to from treex import types, utils from treex.metrics.metric import Metric class Metrics(Metric): metrics: tp.Dict[str, Metric] def __init__( self, metrics: tp.Any, on: tp.Optional[types.IndexLi...
import typing as tp import jax import jax.numpy as jnp import numpy as np import treeo as to from treex import types, utils from treex.metrics.metric import Metric class Metrics(Metric): metrics: tp.Dict[str, Metric] def __init__( self, metrics: tp.Any, on: tp.Optional[types.IndexLi...
en
null
1,331
0036684.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains functions and methods that relate to the DataInfo class which provides a container for informational attributes as well as summary info methods. A DataInfo object is attached to the Quantity, SkyCoord, and ...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains functions and methods that relate to the DataInfo class which provides a container for informational attributes as well as summary info methods. A DataInfo object is attached to the Quantity, SkyCoord, and ...
en
null
6,575
0022264.py
# Copyright (c) 2019 UFCG-LSD. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright (c) 2019 UFCG-LSD. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
en
null
832
0038514.py
r""" Sudoku Puzzles This module provides algorithms to solve Sudoku puzzles, plus tools for inputting, converting and displaying various ways of writing a puzzle or its solution(s). Primarily this is accomplished with the :class:`sage.games.sudoku.Sudoku` class, though the legacy top-level :func:`sage.games.sudoku.su...
r""" Sudoku Puzzles This module provides algorithms to solve Sudoku puzzles, plus tools for inputting, converting and displaying various ways of writing a puzzle or its solution(s). Primarily this is accomplished with the :class:`sage.games.sudoku.Sudoku` class, though the legacy top-level :func:`sage.games.sudoku.su...
en
null
13,721
0004649.py
from django.contrib.sites.models import Site from django.db import models class Article(models.Model): sites = models.ManyToManyField(Site) headline = models.CharField(max_length=100) publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,) class Meta: app_la...
from django.contrib.sites.models import Site from django.db import models class Article(models.Model): sites = models.ManyToManyField(Site) headline = models.CharField(max_length=100) publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,) class Meta: app_la...
en
null
99