hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
2
1.02M
avg_line_length
float64
1
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
f749deea6b841bbcb178c3ad4a786d763a403070
1,772
py
Python
src/testers/unittests/test_immutable_registers.py
Ahmadmansoor/Triton
e1a8538ee1512999589f58c0272f0ee33f33c377
[ "Apache-2.0" ]
2
2019-08-01T06:58:30.000Z
2020-03-28T04:38:12.000Z
src/testers/unittests/test_immutable_registers.py
Ahmadmansoor/Triton
e1a8538ee1512999589f58c0272f0ee33f33c377
[ "Apache-2.0" ]
null
null
null
src/testers/unittests/test_immutable_registers.py
Ahmadmansoor/Triton
e1a8538ee1512999589f58c0272f0ee33f33c377
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python2 # coding: utf-8 """Test immutable registers.""" import unittest import random from triton import * class TestImmutableAArch64Registers(unittest.TestCase): def setUp(self): """Define the arch.""" self.ctx = TritonContext() self.ctx.setArchitecture(ARCH.AARCH64) ...
34.076923
83
0.68623
import unittest import random from triton import * class TestImmutableAArch64Registers(unittest.TestCase): def setUp(self): self.ctx = TritonContext() self.ctx.setArchitecture(ARCH.AARCH64) def test_immutable(self): x1 = self.ctx.registers.x1 x2 = self.ctx.registers.x2 ...
true
true
f749deebab268d5a59cd338fcf355998c2bfae83
336
py
Python
design_patterns/prototype.py
CrazyMath/pywander
d9c8be27c562fe792c9f42f88d3b6a4aa63059e4
[ "MIT" ]
null
null
null
design_patterns/prototype.py
CrazyMath/pywander
d9c8be27c562fe792c9f42f88d3b6a4aa63059e4
[ "MIT" ]
null
null
null
design_patterns/prototype.py
CrazyMath/pywander
d9c8be27c562fe792c9f42f88d3b6a4aa63059e4
[ "MIT" ]
null
null
null
from abc import ABCMeta, abstractmethod from copy import deepcopy class Prototype(metaclass=ABCMeta): @abstractmethod def clone(self): pass class Concrete(Prototype): def clone(self): return deepcopy(self) prototype = Concrete() foo = prototype.clone() bar = prototype.clone() print(...
14
39
0.699405
from abc import ABCMeta, abstractmethod from copy import deepcopy class Prototype(metaclass=ABCMeta): @abstractmethod def clone(self): pass class Concrete(Prototype): def clone(self): return deepcopy(self) prototype = Concrete() foo = prototype.clone() bar = prototype.clone() print(...
true
true
f749df81324f8bef6cf744a61e601dc20edd0726
5,312
py
Python
protein_lm/embed_test.py
egonrian/google-research
8177adbe9ca0d7e5a9463b54581fe6dd27be0974
[ "Apache-2.0" ]
3
2021-01-18T04:46:49.000Z
2021-03-05T09:21:40.000Z
protein_lm/embed_test.py
Alfaxad/google-research
2c0043ecd507e75e2df9973a3015daf9253e1467
[ "Apache-2.0" ]
7
2021-11-10T19:44:38.000Z
2022-02-10T06:48:39.000Z
protein_lm/embed_test.py
Alfaxad/google-research
2c0043ecd507e75e2df9973a3015daf9253e1467
[ "Apache-2.0" ]
4
2021-02-08T10:25:45.000Z
2021-04-17T14:46:26.000Z
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
34.270968
80
0.661145
from absl.testing import absltest from absl.testing import parameterized import mock import numpy as np import tensorflow.compat.v1 as tf from protein_lm import data from protein_lm import embed from protein_lm import models class EncodingTest(parameterized.TestCase, tf.test.TestCase): @parameter...
true
true
f749df8dc570e3ba53eff9646d86aee3a4b99d50
32,715
py
Python
dfvfs/vfs/tsk_file_entry.py
dfjxs/dfvfs
a4154b07bb08c3c86afa2847f3224189dd80c138
[ "Apache-2.0" ]
176
2015-01-02T13:55:39.000Z
2022-03-12T11:44:37.000Z
dfvfs/vfs/tsk_file_entry.py
dfjxs/dfvfs
a4154b07bb08c3c86afa2847f3224189dd80c138
[ "Apache-2.0" ]
495
2015-01-13T06:47:06.000Z
2022-03-12T11:07:03.000Z
dfvfs/vfs/tsk_file_entry.py
dfjxs/dfvfs
a4154b07bb08c3c86afa2847f3224189dd80c138
[ "Apache-2.0" ]
62
2015-02-23T08:19:38.000Z
2022-03-18T06:01:22.000Z
# -*- coding: utf-8 -*- """The SleuthKit (TSK) file entry implementation.""" import copy import decimal from dfdatetime import definitions as dfdatetime_definitions from dfdatetime import factory as dfdatetime_factory from dfdatetime import interface as dfdatetime_interface import pytsk3 from dfvfs.lib import defin...
34.256545
80
0.695583
import copy import decimal from dfdatetime import definitions as dfdatetime_definitions from dfdatetime import factory as dfdatetime_factory from dfdatetime import interface as dfdatetime_interface import pytsk3 from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.path import tsk_path_spec fro...
true
true
f749e07587c2572daf64a5cf1d5c59c1cfbeed02
60,919
py
Python
moto/events/models.py
acapagarcia/moto
82f9917b7f38248ae1a008222ed2394fdbc4409b
[ "Apache-2.0" ]
null
null
null
moto/events/models.py
acapagarcia/moto
82f9917b7f38248ae1a008222ed2394fdbc4409b
[ "Apache-2.0" ]
null
null
null
moto/events/models.py
acapagarcia/moto
82f9917b7f38248ae1a008222ed2394fdbc4409b
[ "Apache-2.0" ]
null
null
null
import copy import os import re import json import sys import warnings from collections import namedtuple from datetime import datetime from enum import Enum, unique from json import JSONDecodeError from operator import lt, le, eq, ge, gt from boto3 import Session from collections import OrderedDict from moto.core.ex...
33.638321
122
0.594724
import copy import os import re import json import sys import warnings from collections import namedtuple from datetime import datetime from enum import Enum, unique from json import JSONDecodeError from operator import lt, le, eq, ge, gt from boto3 import Session from collections import OrderedDict from moto.core.ex...
true
true
f749e08b67ff48f2c1e755fae480d51295255e5b
4,498
py
Python
ServerComponent/venv/Lib/site-packages/recordlinkage/standardise/cleaning.py
CDU55/FakeNews
707bd48dd78851081d98ad21bbdadfc2720bd644
[ "MIT" ]
null
null
null
ServerComponent/venv/Lib/site-packages/recordlinkage/standardise/cleaning.py
CDU55/FakeNews
707bd48dd78851081d98ad21bbdadfc2720bd644
[ "MIT" ]
37
2020-10-20T08:30:53.000Z
2020-12-22T13:15:45.000Z
ServerComponent/venv/Lib/site-packages/recordlinkage/standardise/cleaning.py
CDU55/FakeNews
707bd48dd78851081d98ad21bbdadfc2720bd644
[ "MIT" ]
1
2020-10-19T14:55:23.000Z
2020-10-19T14:55:23.000Z
from __future__ import division from __future__ import absolute_import # from __future__ import unicode_literals from sklearn.feature_extraction.text import strip_accents_ascii, \ strip_accents_unicode def clean(s, lowercase=True, replace_by_none=r'[^ \-\_A-Za-z0-9]+', replace_by_whitespace=r'[\-\_]', ...
28.833333
82
0.632503
from __future__ import division from __future__ import absolute_import from sklearn.feature_extraction.text import strip_accents_ascii, \ strip_accents_unicode def clean(s, lowercase=True, replace_by_none=r'[^ \-\_A-Za-z0-9]+', replace_by_whitespace=r'[\-\_]', strip_accents=None, remove_brac...
true
true
f749e0b02a6ecbc11ba2eef58e6afab0e7e5ec03
1,985
py
Python
justice/summarize.py
aimalz/justice
2edcb471cd01d6659a498bcd0209cb5dae83375a
[ "MIT" ]
1
2018-09-17T01:30:34.000Z
2018-09-17T01:30:34.000Z
justice/summarize.py
aimalz/justice
2edcb471cd01d6659a498bcd0209cb5dae83375a
[ "MIT" ]
38
2018-06-12T18:55:25.000Z
2019-01-13T21:13:09.000Z
justice/summarize.py
aimalz/justice
2edcb471cd01d6659a498bcd0209cb5dae83375a
[ "MIT" ]
2
2018-08-19T21:38:30.000Z
2018-09-09T19:00:03.000Z
"""Tools for summarizing lightcurve data into statistics""" import numpy as np import scipy.optimize as spo from tensorflow.contrib.framework import nest from justice import lightcurve from justice import xform def opt_alignment( lca: lightcurve._LC, lcb: lightcurve._LC, ivals=None, constraints=None...
29.626866
83
0.665995
import numpy as np import scipy.optimize as spo from tensorflow.contrib.framework import nest from justice import lightcurve from justice import xform def opt_alignment( lca: lightcurve._LC, lcb: lightcurve._LC, ivals=None, constraints=None, method='Nelder-Mead', options=None, vb=True, )...
true
true
f749e18e92b0cbc11d8e878aae31bb649d12c212
1,632
py
Python
pan_inventory_frontend/config.py
bradatkinson/pan_inventory
4620fa8c3957ead218c18d1e2efdbd2310eaf9ee
[ "MIT" ]
1
2019-03-07T16:41:03.000Z
2019-03-07T16:41:03.000Z
pan_inventory_frontend/config.py
bradatkinson/pan_inventory
4620fa8c3957ead218c18d1e2efdbd2310eaf9ee
[ "MIT" ]
null
null
null
pan_inventory_frontend/config.py
bradatkinson/pan_inventory
4620fa8c3957ead218c18d1e2efdbd2310eaf9ee
[ "MIT" ]
null
null
null
#!/usr/bin/env python # Copyright (c) 2019 Brad Atkinson <brad.scripting@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ri...
40.8
79
0.72549
paloalto = { 'username': '<USERNAME>', 'password': '<PASSWORD>', 'key': '<API_KEY>', 'panorama_ips': ['<PANO_MGMT_IP1>', '<PANO_MGMT_IP2>'] } mongo = { 'write_username': '<WRITE_USERNAME>', 'write_password': '<WRITE_PASSWORD>', 'read_username': '<READ_USERNAME>', ...
true
true
f749e24c596fa7f7b9205d2c32b1d294f7bf3f71
20,370
py
Python
kmodes/kprototypes.py
nilkeshpatra/kmodes
f4b5582e7bb872b15ec4e2c135fd40bd42642e83
[ "MIT" ]
null
null
null
kmodes/kprototypes.py
nilkeshpatra/kmodes
f4b5582e7bb872b15ec4e2c135fd40bd42642e83
[ "MIT" ]
null
null
null
kmodes/kprototypes.py
nilkeshpatra/kmodes
f4b5582e7bb872b15ec4e2c135fd40bd42642e83
[ "MIT" ]
null
null
null
""" K-prototypes clustering for mixed categorical and numerical data """ # pylint: disable=super-on-old-class,unused-argument,attribute-defined-outside-init from collections import defaultdict import numpy as np from scipy import sparse from sklearn.externals.joblib import Parallel, delayed from sklearn.utils import...
41.741803
92
0.604467
from collections import defaultdict import numpy as np from scipy import sparse from sklearn.externals.joblib import Parallel, delayed from sklearn.utils import check_random_state from sklearn.utils.validation import check_array from . import kmodes from .util import get_max_value_key, encode_features, get_unique_...
true
true
f749e419572be20d59b22710aaca3b9d9923778a
4,122
py
Python
model/utils/text.py
anuragphadnis/im2latex2
3e5bcb400d7bdff9cfd8ed03b821b3b6cb809b9b
[ "Apache-2.0" ]
1
2021-05-09T14:15:09.000Z
2021-05-09T14:15:09.000Z
model/utils/text.py
anuragphadnis/im2latex2
3e5bcb400d7bdff9cfd8ed03b821b3b6cb809b9b
[ "Apache-2.0" ]
null
null
null
model/utils/text.py
anuragphadnis/im2latex2
3e5bcb400d7bdff9cfd8ed03b821b3b6cb809b9b
[ "Apache-2.0" ]
null
null
null
import numpy as np from collections import Counter class Vocab(object): def __init__(self, config): self.config = config self.load_vocab() def load_vocab(self): special_tokens = [self.config.unk, self.config.pad, self.config.end] self.tok_to_id = load_tok_to_id(self.config.p...
26.593548
79
0.609898
import numpy as np from collections import Counter class Vocab(object): def __init__(self, config): self.config = config self.load_vocab() def load_vocab(self): special_tokens = [self.config.unk, self.config.pad, self.config.end] self.tok_to_id = load_tok_to_id(self.config.p...
true
true
f749e4540ff86d3655d5771d0f8033c62422a3a1
1,079
py
Python
clients/client/python/test/test_ui_node.py
simoneromano96/sdk
a6113d0daefbbb803790297e4b242d4c7cbbcb22
[ "Apache-2.0" ]
null
null
null
clients/client/python/test/test_ui_node.py
simoneromano96/sdk
a6113d0daefbbb803790297e4b242d4c7cbbcb22
[ "Apache-2.0" ]
null
null
null
clients/client/python/test/test_ui_node.py
simoneromano96/sdk
a6113d0daefbbb803790297e4b242d4c7cbbcb22
[ "Apache-2.0" ]
null
null
null
""" Ory APIs Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501 The version of the OpenAPI document: v0.0.1-alpha.3 Contact: support@ory.sh Generated by: http...
25.093023
194
0.70899
import sys import unittest import ory_client from ory_client.model.meta import Meta from ory_client.model.ui_node_attributes import UiNodeAttributes from ory_client.model.ui_texts import UiTexts globals()['Meta'] = Meta globals()['UiNodeAttributes'] = UiNodeAttributes globals()['UiTexts'] = UiTexts from ory_client.m...
true
true
f749e4aa19f875cf56f9f883600ab70096c9df9e
4,283
py
Python
python_old/magnetic_field_simulation.py
Devanthro/ball_in_socket_estimator
5793db2dfd22b693c082694c2130a16c92164d70
[ "BSD-3-Clause" ]
3
2018-10-22T03:29:13.000Z
2021-09-24T21:04:01.000Z
python_old/magnetic_field_simulation.py
Devanthro/ball_in_socket_estimator
5793db2dfd22b693c082694c2130a16c92164d70
[ "BSD-3-Clause" ]
null
null
null
python_old/magnetic_field_simulation.py
Devanthro/ball_in_socket_estimator
5793db2dfd22b693c082694c2130a16c92164d70
[ "BSD-3-Clause" ]
1
2021-09-08T10:13:50.000Z
2021-09-08T10:13:50.000Z
import numpy as np import matplotlib.pyplot as plt from magpylib.source.magnet import Box,Cylinder from magpylib import Collection, displaySystem, Sensor from scipy.optimize import fsolve, least_squares import matplotlib.animation as manimation import random import MDAnalysis import MDAnalysis.visualization.streamlines...
40.40566
273
0.578099
import numpy as np import matplotlib.pyplot as plt from magpylib.source.magnet import Box,Cylinder from magpylib import Collection, displaySystem, Sensor from scipy.optimize import fsolve, least_squares import matplotlib.animation as manimation import random import MDAnalysis import MDAnalysis.visualization.streamlines...
true
true
f749e513acf2c204d20a41b2b9d90b606eb61152
21,509
py
Python
test/dialect/oracle/test_reflection.py
gujun4990/sqlalchemy
057bae2295feb86529a04f09cd2f3d4c2c6d88a8
[ "MIT" ]
1
2018-11-15T16:02:17.000Z
2018-11-15T16:02:17.000Z
test/dialect/oracle/test_reflection.py
gujun4990/sqlalchemy
057bae2295feb86529a04f09cd2f3d4c2c6d88a8
[ "MIT" ]
null
null
null
test/dialect/oracle/test_reflection.py
gujun4990/sqlalchemy
057bae2295feb86529a04f09cd2f3d4c2c6d88a8
[ "MIT" ]
null
null
null
# coding: utf-8 from sqlalchemy.testing import eq_, is_ from sqlalchemy import exc from sqlalchemy.sql import table from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import testing from sqlalchemy import Integer, Text, LargeBinary, Unicode, UniqueConstraint,\ Index, MetaData, select, ins...
35.968227
78
0.581849
from sqlalchemy.testing import eq_, is_ from sqlalchemy import exc from sqlalchemy.sql import table from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import testing from sqlalchemy import Integer, Text, LargeBinary, Unicode, UniqueConstraint,\ Index, MetaData, select, inspect, ForeignKe...
true
true
f749e75558947d54bbbb264685613ae938abe891
557
py
Python
examples/simple/app.py
gieseladev/konfi
f6130a77a53ae912614b1be1159118a359cceecf
[ "MIT" ]
1
2019-06-29T18:25:58.000Z
2019-06-29T18:25:58.000Z
examples/simple/app.py
gieseladev/konfi
f6130a77a53ae912614b1be1159118a359cceecf
[ "MIT" ]
4
2020-03-24T17:16:00.000Z
2021-06-01T23:59:16.000Z
examples/simple/app.py
gieseladev/konfi
f6130a77a53ae912614b1be1159118a359cceecf
[ "MIT" ]
null
null
null
import konfi @konfi.template() class UserInfo: name: str country: str @konfi.template() class AppConfig: name: str = "konfi" user: UserInfo if __name__ == "__main__": konfi.set_sources( konfi.YAML("config.yml"), konfi.Env(prefix="app_"), ) # the return type is usually ...
19.892857
75
0.651706
import konfi @konfi.template() class UserInfo: name: str country: str @konfi.template() class AppConfig: name: str = "konfi" user: UserInfo if __name__ == "__main__": konfi.set_sources( konfi.YAML("config.yml"), konfi.Env(prefix="app_"), ) config: AppConfig =...
true
true
f749e76b24b495d66a42c6790db6aadcad34f22e
653
py
Python
word_similarity/Dataset.py
mengzhu0308/word2vec
09f5bb913d1a1007d54bd88ad44ba8c53ecc71ea
[ "Apache-2.0" ]
1
2021-07-24T23:54:37.000Z
2021-07-24T23:54:37.000Z
word_similarity/Dataset.py
mengzhu0308/word2vec
09f5bb913d1a1007d54bd88ad44ba8c53ecc71ea
[ "Apache-2.0" ]
null
null
null
word_similarity/Dataset.py
mengzhu0308/word2vec
09f5bb913d1a1007d54bd88ad44ba8c53ecc71ea
[ "Apache-2.0" ]
null
null
null
''' @Author: ZM @Date and Time: 2019/10/8 6:28 @File: Dataset.py ''' class Dataset: def __init__(self, x, y=None, transform=None, y_transform=None): self.x = x self.y = y self.transform = transform self.y_transform = y_transform def __len__(self): return...
22.517241
68
0.529862
class Dataset: def __init__(self, x, y=None, transform=None, y_transform=None): self.x = x self.y = y self.transform = transform self.y_transform = y_transform def __len__(self): return len(self.x) def __getitem__(self, item): x = self.x[item] if se...
true
true
f749e7fe7c50db3a5b78681b18567d9736b23c8d
6,734
py
Python
code/IO/Output.py
niksell/phenotypes-prediction-using-genotypes-Master-Thesis
c20b6ef89d0979d15266ad572c5aed56e28c4229
[ "MIT" ]
null
null
null
code/IO/Output.py
niksell/phenotypes-prediction-using-genotypes-Master-Thesis
c20b6ef89d0979d15266ad572c5aed56e28c4229
[ "MIT" ]
null
null
null
code/IO/Output.py
niksell/phenotypes-prediction-using-genotypes-Master-Thesis
c20b6ef89d0979d15266ad572c5aed56e28c4229
[ "MIT" ]
null
null
null
import os.path import time import numpy as np from DataStructure.PatientPhenotype import PatientPhenotype from DataStructure.Snp import Snp class Output: def __init__(self,path,numberOfChromosomes): self.__path = path self.__numberOfChromosomes = numberOfChromosomes def w...
33.009804
126
0.407336
import os.path import time import numpy as np from DataStructure.PatientPhenotype import PatientPhenotype from DataStructure.Snp import Snp class Output: def __init__(self,path,numberOfChromosomes): self.__path = path self.__numberOfChromosomes = numberOfChromosomes def w...
true
true
f749e8a3cc5532f05d672b11c34b610b1b28eba9
4,262
py
Python
fashion_mnist_dropout01/model.py
HugoSenetaire/vaeac
451d34dd4986c52f2f37c508f03ee3db9e7408d3
[ "MIT" ]
null
null
null
fashion_mnist_dropout01/model.py
HugoSenetaire/vaeac
451d34dd4986c52f2f37c508f03ee3db9e7408d3
[ "MIT" ]
null
null
null
fashion_mnist_dropout01/model.py
HugoSenetaire/vaeac
451d34dd4986c52f2f37c508f03ee3db9e7408d3
[ "MIT" ]
null
null
null
from torch import nn from torch.optim import Adam from mask_generators import ImageMaskGenerator, DropoutMaskGenerator from nn_utils import ResBlock, MemoryLayer, SkipConnection from prob_utils import normal_parse_params, GaussianLoss # sampler from the model generative distribution # here we return mean of the Gaus...
37.06087
82
0.631394
from torch import nn from torch.optim import Adam from mask_generators import ImageMaskGenerator, DropoutMaskGenerator from nn_utils import ResBlock, MemoryLayer, SkipConnection from prob_utils import normal_parse_params, GaussianLoss def sampler(params): return normal_parse_params(params).mean def optimizer...
true
true
f749eb4ff01b42da4ddb7686df3b71e8b121ec2c
9,087
py
Python
fairseq/modules/conformer_layer.py
ncduy0303/fairseq
a086afb15b7d1737cd98831e975fd21b14ef6b07
[ "MIT" ]
8
2022-03-19T15:20:10.000Z
2022-03-30T20:29:25.000Z
fairseq/modules/conformer_layer.py
ncduy0303/fairseq
a086afb15b7d1737cd98831e975fd21b14ef6b07
[ "MIT" ]
null
null
null
fairseq/modules/conformer_layer.py
ncduy0303/fairseq
a086afb15b7d1737cd98831e975fd21b14ef6b07
[ "MIT" ]
2
2022-03-18T14:42:41.000Z
2022-03-19T15:23:20.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from typing import Optional from fairseq.modules import ( LayerNorm, MultiheadAttention, ESPNETMultiHeadedAttention,...
30.59596
131
0.562892
import torch from typing import Optional from fairseq.modules import ( LayerNorm, MultiheadAttention, ESPNETMultiHeadedAttention, RelPositionMultiHeadedAttention, RotaryPositionMultiHeadedAttention, ) from fairseq.utils import get_activation_fn class ConvolutionModule(torch.nn.Module): ...
true
true
f749eb55979b9450b7317ffbcc30a347d6e0cf7f
51,715
gyp
Python
base/base.gyp
anirudhSK/chromium
a8f23c87e656ab9ba49de9ccccbc53f614cdcb41
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
base/base.gyp
anirudhSK/chromium
a8f23c87e656ab9ba49de9ccccbc53f614cdcb41
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
base/base.gyp
anirudhSK/chromium
a8f23c87e656ab9ba49de9ccccbc53f614cdcb41
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2015-04-17T13:19:09.000Z
2021-10-21T12:55:15.000Z
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'includes': [ '../build/win_precompile.gypi', 'base.gypi', ], 'targets': [ { 'tar...
34.522697
160
0.538973
{ 'variables': { 'chromium_code': 1, }, 'includes': [ '../build/win_precompile.gypi', 'base.gypi', ], 'targets': [ { 'target_name': 'base', 'type': '<(component)', 'toolsets': ['host', 'target'], 'variables': { 'base_target': 1, 'enable_wexit_time_de...
true
true
f749eb7f645d9478b8aaeb0944b510998d7bc38e
812
py
Python
src/algorithm/graph/bfs.py
krjakbrjak/algo-pg
1ad6cffea69c0a35139a6fc89e4766079f2a90cd
[ "MIT" ]
null
null
null
src/algorithm/graph/bfs.py
krjakbrjak/algo-pg
1ad6cffea69c0a35139a6fc89e4766079f2a90cd
[ "MIT" ]
null
null
null
src/algorithm/graph/bfs.py
krjakbrjak/algo-pg
1ad6cffea69c0a35139a6fc89e4766079f2a90cd
[ "MIT" ]
null
null
null
from collections import deque from dataclasses import dataclass, field from typing import Iterator, Tuple from algorithm.graph.node import Graph, Node @dataclass class BFS: graph: Graph = field(default_factory=Graph) visited: Tuple[int, ...] = field(default_factory=tuple) queue: deque = field(default_fac...
30.074074
84
0.628079
from collections import deque from dataclasses import dataclass, field from typing import Iterator, Tuple from algorithm.graph.node import Graph, Node @dataclass class BFS: graph: Graph = field(default_factory=Graph) visited: Tuple[int, ...] = field(default_factory=tuple) queue: deque = field(default_fac...
true
true
f749ebb2e1acbb574f2ca574909aa17201334895
12,252
py
Python
corehq/util/couch.py
rochakchauhan/commcare-hq
aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236
[ "BSD-3-Clause" ]
null
null
null
corehq/util/couch.py
rochakchauhan/commcare-hq
aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236
[ "BSD-3-Clause" ]
null
null
null
corehq/util/couch.py
rochakchauhan/commcare-hq
aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236
[ "BSD-3-Clause" ]
null
null
null
import json import traceback from collections import defaultdict, namedtuple from copy import deepcopy from functools import partial from time import sleep from couchdbkit import ResourceNotFound, BulkSaveError, Document from django.conf import settings from django.http import Http404 from jsonobject.exceptions import...
34.128134
100
0.622103
import json import traceback from collections import defaultdict, namedtuple from copy import deepcopy from functools import partial from time import sleep from couchdbkit import ResourceNotFound, BulkSaveError, Document from django.conf import settings from django.http import Http404 from jsonobject.exceptions import...
true
true
f749ebe971fabbff24ef208b7de71c6974532cf7
1,880
py
Python
tests/test_models_cast.py
jdolter/django-tagulous
90c6ee5ac54ef1127f2edcfac10c5ef3ab09e255
[ "Apache-2.0" ]
null
null
null
tests/test_models_cast.py
jdolter/django-tagulous
90c6ee5ac54ef1127f2edcfac10c5ef3ab09e255
[ "Apache-2.0" ]
null
null
null
tests/test_models_cast.py
jdolter/django-tagulous
90c6ee5ac54ef1127f2edcfac10c5ef3ab09e255
[ "Apache-2.0" ]
null
null
null
""" Test cast_class in tagulous.models.tagged """ import inspect import pickle from pytest import fixture from tagulous.models.cast import cast_instance, get_cast_class from tests.tagulous_tests_app.cast import NewBase, OldBase, Target EXPECTED_CAST_NAME = "TagulousCastTaggedTarget" @fixture def Cast(): # Cr...
24.415584
82
0.743085
import inspect import pickle from pytest import fixture from tagulous.models.cast import cast_instance, get_cast_class from tests.tagulous_tests_app.cast import NewBase, OldBase, Target EXPECTED_CAST_NAME = "TagulousCastTaggedTarget" @fixture def Cast(): cls = get_cast_class(Target, NewBase) yield c...
true
true
f749ed20f187461a2f5bd335783260c5605e13b8
478
py
Python
student_form/urls.py
study-abacus/admin-site
045168cae3edcc95a3bb068d7b1ba19a87bf3070
[ "MIT" ]
1
2020-10-19T09:26:38.000Z
2020-10-19T09:26:38.000Z
student_form/urls.py
study-abacus/admin-site
045168cae3edcc95a3bb068d7b1ba19a87bf3070
[ "MIT" ]
10
2018-10-25T21:06:12.000Z
2021-06-10T20:57:46.000Z
student_form/urls.py
study-abacus/admin-site
045168cae3edcc95a3bb068d7b1ba19a87bf3070
[ "MIT" ]
1
2020-10-19T08:55:16.000Z
2020-10-19T08:55:16.000Z
from django.urls import include, path from django.contrib import admin from django.views.generic import RedirectView from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('form/', include('form.urls...
28.117647
72
0.723849
from django.urls import include, path from django.contrib import admin from django.views.generic import RedirectView from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), path('form/', include('form.urls...
true
true
f749edbe7964f57022b5f851137918b5a43577b8
998
py
Python
examples/Translation/ai/tests.py
hungpdn/h1st
0b733c7b9b194098577920efd048494ed370b2e8
[ "Apache-2.0" ]
1
2021-12-31T08:51:11.000Z
2021-12-31T08:51:11.000Z
examples/Translation/ai/tests.py
hungpdn/h1st
0b733c7b9b194098577920efd048494ed370b2e8
[ "Apache-2.0" ]
null
null
null
examples/Translation/ai/tests.py
hungpdn/h1st
0b733c7b9b194098577920efd048494ed370b2e8
[ "Apache-2.0" ]
null
null
null
from models.google_cloud import GoogleLanguageTranslationModel, HuggingFaceLanguageTranslationModel from models.en2spa_transformer import En2SpaSeq2SeqTransformer def test_google_translation(): model = GoogleLanguageTranslationModel() assert model.predict(text='Hello', target='de') == 'Hallo' def test_hugging...
32.193548
99
0.758517
from models.google_cloud import GoogleLanguageTranslationModel, HuggingFaceLanguageTranslationModel from models.en2spa_transformer import En2SpaSeq2SeqTransformer def test_google_translation(): model = GoogleLanguageTranslationModel() assert model.predict(text='Hello', target='de') == 'Hallo' def test_hugging...
true
true
f749ef6a05c80c1668fbb61b84481f0307a53bd6
3,986
py
Python
apps/sync.py
Ian-HR/smartwatch
ab0dc635a515632e7d932ff60dea5d0f0638f0c9
[ "MIT" ]
null
null
null
apps/sync.py
Ian-HR/smartwatch
ab0dc635a515632e7d932ff60dea5d0f0638f0c9
[ "MIT" ]
null
null
null
apps/sync.py
Ian-HR/smartwatch
ab0dc635a515632e7d932ff60dea5d0f0638f0c9
[ "MIT" ]
null
null
null
def btSync(display, utime, ujson, bluetooth, startNewThread, playBuzzer, loadJSON, saveJSON, showControls, update, clear): run = True toDo = loadJSON("to-do.json") toDoList = list(toDo.keys()) toDoDone = False shoppingItems = loadJSON("boodschappen.json") shoppingItemsList = list(shoppingItems....
35.589286
122
0.465881
def btSync(display, utime, ujson, bluetooth, startNewThread, playBuzzer, loadJSON, saveJSON, showControls, update, clear): run = True toDo = loadJSON("to-do.json") toDoList = list(toDo.keys()) toDoDone = False shoppingItems = loadJSON("boodschappen.json") shoppingItemsList = list(shoppingItems....
true
true
f749f1835e42d7601a93c572e57297d6999819c9
7,770
py
Python
src/banderplug.py
jruzi24/BanderPlug
ab39ffff586187e4a6ed77b67e0342789e0e4a97
[ "MIT" ]
null
null
null
src/banderplug.py
jruzi24/BanderPlug
ab39ffff586187e4a6ed77b67e0342789e0e4a97
[ "MIT" ]
null
null
null
src/banderplug.py
jruzi24/BanderPlug
ab39ffff586187e4a6ed77b67e0342789e0e4a97
[ "MIT" ]
null
null
null
""" banderplug.py Author: Jacob Ruzi This script is intended to be run with an ini formatted configuration file that defines a 'Choose Your Own Adventure' game. See example_game.ini and README.md for guidelines on how to format your game. See BanderPlug.log in the current directory for error details. """ import config...
39.441624
118
0.600901
import configparser import logging.config import re import argparse import os.path logging.config.fileConfig(os.path.join('conf','logging.conf')) logger = logging.getLogger('banderlog') class BanderGame: def __init__(self,gameFile): self.stage = '0' self.title = '' self.__loadS...
true
true
f749f2a9095679e72f8bdebc813b9f53d4a85fdf
5,505
py
Python
pyautomagic/src/rateQuality.py
NeuroDataDesign/pyautomagic
b33f69d99e4ea06e9368fb7a8b1a4e498028b18c
[ "MIT" ]
6
2019-11-04T08:45:08.000Z
2021-11-27T16:07:23.000Z
pyautomagic/src/rateQuality.py
ragatti/pyautomagic
f03af3f4f0cf859c11d03623d9d2b51f1546b6d7
[ "MIT" ]
23
2019-09-22T19:42:15.000Z
2020-02-10T17:33:11.000Z
pyautomagic/src/rateQuality.py
ragatti/pyautomagic
f03af3f4f0cf859c11d03623d9d2b51f1546b6d7
[ "MIT" ]
5
2019-11-11T10:44:05.000Z
2020-12-13T02:48:57.000Z
# Copyright 2019 NeuroData (http://neurodata.io) # # 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 ag...
39.891304
108
0.626703
import logging logging.basicConfig( format="%(asctime)s : %(levelname)s: %(message)s", level=logging.DEBUG ) def rateQuality( quality_metrics: dict, overall_Good_Cutoff: float = 0.1, overall_Bad_Cutoff: float = 0.2, time_Good_Cutoff: float = 0.1, time_Bad_Cutoff: float = 0.2,...
true
true
f749f330d39ab30b40cb1fa874fe91d14348e01f
551
py
Python
src/django_server/manage.py
guandjoy/redject
ebcf7f25c6ef05af229aebcee0e5ff0728e34c9e
[ "MIT" ]
43
2019-07-14T14:27:49.000Z
2022-02-03T18:20:14.000Z
src/django_server/manage.py
guandjoy/redject
ebcf7f25c6ef05af229aebcee0e5ff0728e34c9e
[ "MIT" ]
11
2019-12-04T23:43:47.000Z
2022-02-10T07:56:43.000Z
src/django_server/manage.py
guandjoy/redject
ebcf7f25c6ef05af229aebcee0e5ff0728e34c9e
[ "MIT" ]
14
2019-12-20T13:51:05.000Z
2022-02-04T17:14:11.000Z
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_server.settings.local') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import ...
34.4375
83
0.69147
import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_server.settings.local') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure ...
true
true
f749f34cd2ac26f46e37fc5e75341047be7ea4f1
6,212
py
Python
netcam_aioeos/topology/eos_check_mlags.py
jeremyschulman/netcam-aioeos
ae8b46bcef1bbd86441342a9a282e404d597d662
[ "Apache-2.0" ]
null
null
null
netcam_aioeos/topology/eos_check_mlags.py
jeremyschulman/netcam-aioeos
ae8b46bcef1bbd86441342a9a282e404d597d662
[ "Apache-2.0" ]
null
null
null
netcam_aioeos/topology/eos_check_mlags.py
jeremyschulman/netcam-aioeos
ae8b46bcef1bbd86441342a9a282e404d597d662
[ "Apache-2.0" ]
1
2022-01-04T19:55:12.000Z
2022-01-04T19:55:12.000Z
# Copyright 2021 Jeremy Schulman # # 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 ...
33.76087
88
0.565196
from typing import TYPE_CHECKING, AsyncGenerator, Generator import re from pydantic import BaseModel from netcad.topology.checks.check_mlags import ( MLagCheckCollection, MLagSystemCheckParams, MLagSystemCheck, ) from netcad.topology.checks.check_lags import LagCheck from...
true
true
f749f5666983a949bd61ead07e2f9aad07514426
5,286
py
Python
python/lookup_tables.py
robertmacdavid/approx-upf
3f6da80226f94b175afe0c9d463fa38abfd743b9
[ "Apache-2.0" ]
null
null
null
python/lookup_tables.py
robertmacdavid/approx-upf
3f6da80226f94b175afe0c9d463fa38abfd743b9
[ "Apache-2.0" ]
1
2022-03-24T23:47:04.000Z
2022-03-24T23:47:04.000Z
python/lookup_tables.py
robertmacdavid/approx-upf
3f6da80226f94b175afe0c9d463fa38abfd743b9
[ "Apache-2.0" ]
null
null
null
from typing import List, Callable, Dict, Tuple, Union import math import matplotlib.pyplot as plt class ApproxMultiplicationTable: """ Multiplication done using a lookup table instead of a math unit """ table_entries: Dict[Tuple[int, int], int] num_significant_bits: int def __init__(self, nu...
40.661538
111
0.622777
from typing import List, Callable, Dict, Tuple, Union import math import matplotlib.pyplot as plt class ApproxMultiplicationTable: table_entries: Dict[Tuple[int, int], int] num_significant_bits: int def __init__(self, num_significant_bits: int, unbiasing: float = 0.5): self.num_significant_bits ...
true
true
f749f6e00729c2cc65ae250e8a020020a8ed5757
920
py
Python
rst2txt/__init__.py
hroncok/rst2txt
9a497d7e277df9a84bc9a89f3a19a7736ab78ecb
[ "BSD-2-Clause" ]
2
2019-05-15T12:31:37.000Z
2020-09-09T08:10:17.000Z
rst2txt/__init__.py
hroncok/rst2txt
9a497d7e277df9a84bc9a89f3a19a7736ab78ecb
[ "BSD-2-Clause" ]
null
null
null
rst2txt/__init__.py
hroncok/rst2txt
9a497d7e277df9a84bc9a89f3a19a7736ab78ecb
[ "BSD-2-Clause" ]
1
2021-03-31T09:46:33.000Z
2021-03-31T09:46:33.000Z
# -*- coding: utf-8 -*- """ rst2txt.__main__ ~~~~~~~~~~~~~~~~ A minimal front end to the Docutils Publisher, producing plain text. :copyright: Copyright 2018, Stephen Finucane <stephen@that.guru>. :license: BSD, see LICENSE for details. """ import locale locale.setlocale(locale.LC_ALL, '') # noqa...
27.058824
72
0.711957
import locale locale.setlocale(locale.LC_ALL, '') from docutils.core import default_description from docutils.core import publish_cmdline from pkg_resources import DistributionNotFound from pkg_resources import get_distribution from rst2txt.writer import Writer try: __version__ = get_distribution(__name__).ve...
true
true
f749f7c83a8388660a3d8472126ca9d789524a23
267
py
Python
tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_128_Difference_PolyTrend_12_12_20.py
shaido987/pyaf
b9afd089557bed6b90b246d3712c481ae26a1957
[ "BSD-3-Clause" ]
377
2016-10-13T20:52:44.000Z
2022-03-29T18:04:14.000Z
tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_128_Difference_PolyTrend_12_12_20.py
ysdede/pyaf
b5541b8249d5a1cfdc01f27fdfd99b6580ed680b
[ "BSD-3-Clause" ]
160
2016-10-13T16:11:53.000Z
2022-03-28T04:21:34.000Z
tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_128_Difference_PolyTrend_12_12_20.py
ysdede/pyaf
b5541b8249d5a1cfdc01f27fdfd99b6580ed680b
[ "BSD-3-Clause" ]
63
2017-03-09T14:51:18.000Z
2022-03-27T20:52:57.000Z
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 12);
38.142857
167
0.734082
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 12);
true
true
f749f7f15f12cec50986c89ae20a1ca1fd7c2e80
2,188
py
Python
muskit/layers/conformer/convolution.py
A-Quarter-Mile/Muskits
60d80727d2ec6b8ec405502d67796e8df319ea82
[ "Apache-2.0" ]
74
2021-04-15T15:39:32.000Z
2022-03-23T03:34:25.000Z
muskit/layers/conformer/convolution.py
A-Quarter-Mile/Muskits
60d80727d2ec6b8ec405502d67796e8df319ea82
[ "Apache-2.0" ]
33
2021-04-30T18:24:47.000Z
2022-03-29T13:27:40.000Z
muskit/layers/conformer/convolution.py
A-Quarter-Mile/Muskits
60d80727d2ec6b8ec405502d67796e8df319ea82
[ "Apache-2.0" ]
24
2021-04-15T15:20:32.000Z
2022-03-19T04:03:25.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2020 Johns Hopkins University (Shinji Watanabe) # Northwestern Polytechnical University (Pengcheng Guo) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ConvolutionModule definition.""" from torch import nn class ConvolutionMod...
29.173333
79
0.562614
from torch import nn class ConvolutionModule(nn.Module): def __init__(self, channels, kernel_size, activation=nn.ReLU(), bias=True): super(ConvolutionModule, self).__init__() assert (kernel_size - 1) % 2 == 0 self.pointwise_conv1 = nn.Conv1d( channels, ...
true
true
f749f85fe5a0087efafef2dd98f596dc4ec57060
8,043
py
Python
Code/Python/bootcamp_examples.py
kunal-mulki/Materials
b76bba123002972e4063b9b24cd5dc3d980e16e9
[ "MIT" ]
27
2016-12-07T17:38:41.000Z
2021-06-28T06:19:49.000Z
Code/Python/bootcamp_examples.py
kunal-mulki/Materials
b76bba123002972e4063b9b24cd5dc3d980e16e9
[ "MIT" ]
27
2016-05-28T21:32:24.000Z
2016-12-08T16:47:09.000Z
Code/Python/bootcamp_examples.py
NYUDataBootcamp/Materials
b76bba123002972e4063b9b24cd5dc3d980e16e9
[ "MIT" ]
50
2016-10-12T11:04:50.000Z
2021-06-01T23:24:45.000Z
""" Examples for Data Bootcamp course (data input and graphics) **Warning** Web data access will change in the near future, when Pandas spins off the web access tools into a new package. http://pandas.pydata.org/pandas-docs/stable/remote_data.html Repository of materials (including this file): * https://github.com/NY...
29.141304
91
0.684695
import pandas as pd import sys print('\nPython version:', sys.version) print('Pandas version: ', pd.__version__) import pandas as pd from pandas.io import wb import matplotlib.pyplot as plt var = ['NY.GDP.PCAP.PP.KD', 'NY.GDP.MKTP.PP.KD', 'SP.DYN.LE00.IN'] iso = ['USA', 'FRA'...
true
true
f749f8d00d09a07a09a951938788a41b144605cd
3,195
py
Python
tests/test_main.py
mvj3/prints_a_multiplication_table_of_primes_numbers
571298802f889a1eb4c397ae9bfa4fea0a2a558c
[ "MIT" ]
1
2018-07-11T08:10:45.000Z
2018-07-11T08:10:45.000Z
tests/test_main.py
mvj3/prints_a_multiplication_table_of_primes_numbers
571298802f889a1eb4c397ae9bfa4fea0a2a558c
[ "MIT" ]
null
null
null
tests/test_main.py
mvj3/prints_a_multiplication_table_of_primes_numbers
571298802f889a1eb4c397ae9bfa4fea0a2a558c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import os import sys root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, root_dir) import unittest class TestMain(unittest.TestCase): def test_main(self): # NOTE the blank index of result is a minor different to the requirement. # If...
37.151163
106
0.57277
import os import sys root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, root_dir) import unittest class TestMain(unittest.TestCase): def test_main(self): from prints_a_multiplication_table_of_primes_numbers import PrimeTable co...
true
true
f749f9585378f9f0aff3ca207b337636ab59ff67
1,271
py
Python
test/test_reservation.py
waitlisted/waitlisted-python
87c51fd793fe80b61464e4c5c49b81648cc50827
[ "Apache-2.0" ]
1
2017-03-01T01:31:21.000Z
2017-03-01T01:31:21.000Z
test/test_reservation.py
waitlisted/waitlisted-python
87c51fd793fe80b61464e4c5c49b81648cc50827
[ "Apache-2.0" ]
null
null
null
test/test_reservation.py
waitlisted/waitlisted-python
87c51fd793fe80b61464e4c5c49b81648cc50827
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Waitlisted API Waitlisted API OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obt...
23.537037
76
0.704957
from __future__ import absolute_import import os import sys import unittest import waitlisted from waitlisted.rest import ApiException from waitlisted.models.reservation import Reservation class TestReservation(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def ...
true
true
f749f976bfa4b2085597175053cf8bfbed5d49e6
1,000
py
Python
src/webgui.py
Yobmod/dmlsrim
a2972a5c2f5a7a76f8be31913e04d8a396b4cf02
[ "MIT" ]
null
null
null
src/webgui.py
Yobmod/dmlsrim
a2972a5c2f5a7a76f8be31913e04d8a396b4cf02
[ "MIT" ]
1
2020-02-27T12:42:45.000Z
2020-02-27T12:42:45.000Z
src/webgui.py
Yobmod/dmlsrim
a2972a5c2f5a7a76f8be31913e04d8a396b4cf02
[ "MIT" ]
null
null
null
from fastapi import FastAPI from starlette.responses import PlainTextResponse from starlette.staticfiles import StaticFiles from typing import Dict, Optional as Opt from pydantic import BaseModel from starlette.requests import Request """ * Have programme create the srimdata and pickle/sqlite it * create api points wi...
22.222222
68
0.721
from fastapi import FastAPI from starlette.responses import PlainTextResponse from starlette.staticfiles import StaticFiles from typing import Dict, Optional as Opt from pydantic import BaseModel from starlette.requests import Request class Item(BaseModel): name: str description: Opt[str] = None price: f...
true
true
f749fa712afcdd310efacae9ae01a693cc8c5588
644
py
Python
examples/Boards/ESP32/Storage/sdcard.py
myhumankit/ESP32_IDE_accessible
5262a5dd106f3f52a374a6c1ef68ff53d8847001
[ "MIT" ]
1
2020-07-27T19:32:56.000Z
2020-07-27T19:32:56.000Z
examples/Boards/ESP32/Storage/sdcard.py
myhumankit/Blind_IDE
5262a5dd106f3f52a374a6c1ef68ff53d8847001
[ "MIT" ]
null
null
null
examples/Boards/ESP32/Storage/sdcard.py
myhumankit/Blind_IDE
5262a5dd106f3f52a374a6c1ef68ff53d8847001
[ "MIT" ]
null
null
null
#hardware platform:FireBeetle-ESP32 import SD import os sd = SD.sdcard() #create sdcard object os.mount(sd,"/sd") #mount sdcard with specified dir print(os.listdir("/sd")) #print the filename in '/sd' dir f=open("sd/HelloWord.txt","w") #open file 'HelloWord.txt' in ...
107.333333
328
0.552795
true
true
f749fa8c9748767a6181804edc3a6e6eeaa4cf3d
745
py
Python
src/psc_parse/psc_class.py
satamame/psc_parse
397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31
[ "MIT" ]
null
null
null
src/psc_parse/psc_class.py
satamame/psc_parse
397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31
[ "MIT" ]
null
null
null
src/psc_parse/psc_class.py
satamame/psc_parse
397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31
[ "MIT" ]
null
null
null
'''台本の行の種類の定義 ''' from enum import Enum class PscClass(Enum): '''台本の行の種類 ''' TITLE = 0 # 題名 AUTHOR = 1 # 著者名 CHARSHEADLINE = 2 # 登場人物見出し CHARACTER = 3 # 登場人物 H1 = 4 # 柱 (レベル1) H2 = 5 ...
27.592593
44
0.414765
from enum import Enum class PscClass(Enum): TITLE = 0 AUTHOR = 1 CHARSHEADLINE = 2 CHARACTER = 3 H1 = 4 H2 = 5 H3 = 6 DIRECTION = 7 DIAL...
true
true
f749fbf254f2e3e2d42c56e525f5f6d542742705
2,743
py
Python
integration-testing/test/cl_node/client_parser.py
srinivasreddy/CasperLabs
bb299b3257d8291ccf713e4a27d62d7d486582f5
[ "Apache-2.0" ]
1
2019-10-16T06:05:41.000Z
2019-10-16T06:05:41.000Z
integration-testing/test/cl_node/client_parser.py
srinivasreddy/CasperLabs
bb299b3257d8291ccf713e4a27d62d7d486582f5
[ "Apache-2.0" ]
null
null
null
integration-testing/test/cl_node/client_parser.py
srinivasreddy/CasperLabs
bb299b3257d8291ccf713e4a27d62d7d486582f5
[ "Apache-2.0" ]
null
null
null
from collections import defaultdict import re """ Parser of the gRPC message dump for human reading as produced by scalapb and printed by the Scala CasperLabs client. """ class MaybeList(list): def __getattr__(self, name): if len(self) != 1: raise Exception( f"Attempt to acces...
25.398148
116
0.547211
from collections import defaultdict import re class MaybeList(list): def __getattr__(self, name): if len(self) != 1: raise Exception( f"Attempt to access attribute '{name}' of a list of length {len(self)}" ) return getattr(self[0], name) class PropertyBag...
true
true
f749fc718e8a9f3c7b9640366d7bd9405ff775a6
9,941
py
Python
tests/ut/python/dataset/test_vocab.py
Vincent34/mindspore
a39a60878a46e7e9cb02db788c0bca478f2fa6e5
[ "Apache-2.0" ]
3,200
2020-02-17T12:45:41.000Z
2022-03-31T20:21:16.000Z
tests/ut/python/dataset/test_vocab.py
peixinhou/mindspore
fcb2ec2779b753e95c762cf292b23bd81d1f561b
[ "Apache-2.0" ]
176
2020-02-12T02:52:11.000Z
2022-03-28T22:15:55.000Z
tests/ut/python/dataset/test_vocab.py
peixinhou/mindspore
fcb2ec2779b753e95c762cf292b23bd81d1f561b
[ "Apache-2.0" ]
621
2020-03-09T01:31:41.000Z
2022-03-30T03:43:19.000Z
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # 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 agre...
45.600917
120
0.626396
import numpy as np import mindspore.dataset as ds import mindspore.dataset.text as text import mindspore.common.dtype as mstype from mindspore import log as logger DATA_FILE = "../data/dataset/testVocab/words.txt" VOCAB_FILE = "../data/dataset/testVocab/vocab_list.txt" SIMPLE_VOCAB_FILE = "../data/dat...
true
true
f749fcc4887450ff969c5a97e8745992301c6e5b
4,667
py
Python
migrations/versions/5181f24c23aa_integrate_accuracy_report_with_auto_annotation.py
apaniukov/workbench
2f2653ecfd0143d2d53e33ad84379f13443fdfaa
[ "Apache-2.0" ]
23
2022-03-17T12:24:09.000Z
2022-03-31T09:13:30.000Z
migrations/versions/5181f24c23aa_integrate_accuracy_report_with_auto_annotation.py
apaniukov/workbench
2f2653ecfd0143d2d53e33ad84379f13443fdfaa
[ "Apache-2.0" ]
18
2022-03-21T08:17:44.000Z
2022-03-30T12:42:30.000Z
migrations/versions/5181f24c23aa_integrate_accuracy_report_with_auto_annotation.py
apaniukov/workbench
2f2653ecfd0143d2d53e33ad84379f13443fdfaa
[ "Apache-2.0" ]
16
2022-03-17T12:24:14.000Z
2022-03-31T12:15:12.000Z
"""Integrate accuracy report with auto annotation Revision ID: 5181f24c23aa Revises: 810f7e51911d Create Date: 2021-07-22 19:38:41.741133 """ """ OpenVINO DL Workbench Migration: Integrate accuracy report with auto annotation Copyright (c) 2021 Intel Corporation Licensed under the Apache License, Version 2.0 (...
30.109677
117
0.723163
from contextlib import closing from typing import List import sqlalchemy as sa from alembic import op from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base from migrations.utils import SQLEnumMigrator revision = '5181f24c23aa' down_revision = '810f7e51911d' branch_labels = None depend...
true
true
f749fcd26fb15720f59ea32d2fdccb80ffdcfa8a
479
py
Python
bbpyp/ll_combinator/model/position.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
bbpyp/ll_combinator/model/position.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
bbpyp/ll_combinator/model/position.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
class Position: def __init__(self, line, column): self._line = line self._column = column @property def line(self): return self._line @line.setter def line(self, line): self._line = line @property def column(self): return self._column @column.s...
19.958333
67
0.588727
class Position: def __init__(self, line, column): self._line = line self._column = column @property def line(self): return self._line @line.setter def line(self, line): self._line = line @property def column(self): return self._column @column.s...
true
true
f749fcdcbd6fc4fbc3232acd080b2b98aa1e6021
35
py
Python
demo_zinnia_markitup/__init__.py
lud0/zinnia-wysiwyg-markitup
89a208eb42894f1710333f44d720f858190d07d0
[ "BSD-3-Clause" ]
1
2020-08-06T19:24:34.000Z
2020-08-06T19:24:34.000Z
demo_zinnia_markitup/__init__.py
lud0/zinnia-wysiwyg-markitup
89a208eb42894f1710333f44d720f858190d07d0
[ "BSD-3-Clause" ]
3
2017-03-16T12:00:22.000Z
2019-07-01T14:32:30.000Z
demo_zinnia_markitup/__init__.py
lud0/zinnia-wysiwyg-markitup
89a208eb42894f1710333f44d720f858190d07d0
[ "BSD-3-Clause" ]
2
2018-08-20T06:16:09.000Z
2018-11-11T09:34:57.000Z
"""Demo of Zinnia with MarkItUp"""
17.5
34
0.685714
true
true
f749fd8667a3739e344cd81c4d1c24c5e879c315
802
py
Python
210201/step_4.py
EvgenDEP1/python-adv
892fbedbd17f547140c4ebd42527e6ee7bf1eeca
[ "Apache-2.0" ]
null
null
null
210201/step_4.py
EvgenDEP1/python-adv
892fbedbd17f547140c4ebd42527e6ee7bf1eeca
[ "Apache-2.0" ]
null
null
null
210201/step_4.py
EvgenDEP1/python-adv
892fbedbd17f547140c4ebd42527e6ee7bf1eeca
[ "Apache-2.0" ]
1
2021-05-23T18:05:32.000Z
2021-05-23T18:05:32.000Z
import re from sys import getsizeof import requests # RE_XLS_FILE = re.compile(r'<a.+</a>') # RE_XLS_FILE = re.compile(r'href=".+"') # RE_XLS_FILE = re.compile(r'href="[^"]+\.xls"') RE_XLS_FILE = re.compile(r'href="([^"]+\.xls)"') request_url = 'https://kpk.kss45.ru/%D1%83%D1%87%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F-%D1%80%...
33.416667
201
0.683292
import re from sys import getsizeof import requests RE_XLS_FILE = re.compile(r'href="([^"]+\.xls)"') request_url = 'https://kpk.kss45.ru/%D1%83%D1%87%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0/%D1%80%D0%B0%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5_%D0%BF%D0%B0%D1%80.html' response =...
true
true
f749fdd7f34f0acea1b5a7215ac0519c1b1152be
1,074
py
Python
ft/templatetags/ft_tags.py
xurble/FeedThing
105ce667e7ab245998c030c5bcc7ea42aacce586
[ "MIT" ]
1
2020-04-26T01:18:38.000Z
2020-04-26T01:18:38.000Z
ft/templatetags/ft_tags.py
xurble/FeedThing
105ce667e7ab245998c030c5bcc7ea42aacce586
[ "MIT" ]
6
2019-05-15T14:48:29.000Z
2021-05-15T09:31:57.000Z
ft/templatetags/ft_tags.py
xurble/FeedThing
105ce667e7ab245998c030c5bcc7ea42aacce586
[ "MIT" ]
1
2020-04-29T07:04:41.000Z
2020-04-29T07:04:41.000Z
from django import template from django.utils.safestring import mark_safe register = template.Library() @register.filter(name='hoursmins') def hoursmins(value): if value == None or value == "": return "" s = int(value) * 60 hours, remainder = divmod(s, 3600) minutes, seconds = di...
20.653846
56
0.580074
from django import template from django.utils.safestring import mark_safe register = template.Library() @register.filter(name='hoursmins') def hoursmins(value): if value == None or value == "": return "" s = int(value) * 60 hours, remainder = divmod(s, 3600) minutes, seconds = di...
true
true
f74a012863462e185f965cafd746b6a0f3843653
2,692
py
Python
portfolio/Python/scrapy/refitmyhome/refithome.py
0--key/lib
ba7a85dda2b208adc290508ca617bdc55a5ded22
[ "Apache-2.0" ]
null
null
null
portfolio/Python/scrapy/refitmyhome/refithome.py
0--key/lib
ba7a85dda2b208adc290508ca617bdc55a5ded22
[ "Apache-2.0" ]
null
null
null
portfolio/Python/scrapy/refitmyhome/refithome.py
0--key/lib
ba7a85dda2b208adc290508ca617bdc55a5ded22
[ "Apache-2.0" ]
5
2016-03-22T07:40:46.000Z
2021-05-30T16:12:21.000Z
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from product_spiders.items import ProductLoader, Product import re class refithomeSpider(BaseSpider): name = "refitmyhome.com" allowed_domains = ["refitmyhome.com"] start_urls = ['http://re...
39.014493
132
0.539747
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from product_spiders.items import ProductLoader, Product import re class refithomeSpider(BaseSpider): name = "refitmyhome.com" allowed_domains = ["refitmyhome.com"] start_urls = ['http://re...
true
true
f74a015f9ef940f771af11dead920ae503ca8246
785
py
Python
tests/handwritten/h-ed/h-ed-input-tests.py
michaelackermannaiub/py-fortranformat
edc530d5edde41f41939c716da8e1ef01fa8a6fe
[ "MIT" ]
3
2020-06-19T06:32:02.000Z
2022-02-10T01:10:51.000Z
tests/handwritten/h-ed/h-ed-input-tests.py
michaelackermannaiub/py-fortranformat
edc530d5edde41f41939c716da8e1ef01fa8a6fe
[ "MIT" ]
3
2019-09-16T11:07:34.000Z
2021-07-11T10:59:44.000Z
tests/misc/h-ed-input-tests.py
simright/py-fortranformat-old
8bdc8bbc9c78cbbe6ceb0ed7db211efb5d392177
[ "MIT" ]
3
2019-09-18T07:42:53.000Z
2021-12-19T17:46:12.000Z
import unittest import os import sys from fortranformat._input import input as _input from fortranformat._lexer import lexer as _lexer from fortranformat._parser import parser as _parser from fortranformat._exceptions import InvalidFormat import fortranformat.config as config class HEditDescriptorTests(unit...
27.068966
69
0.673885
import unittest import os import sys from fortranformat._input import input as _input from fortranformat._lexer import lexer as _lexer from fortranformat._parser import parser as _parser from fortranformat._exceptions import InvalidFormat import fortranformat.config as config class HEditDescriptorTests(unit...
true
true
f74a01729c7a3130b5907a14d64ca4f8ff1620ba
7,066
py
Python
airflow/utils/helpers.py
rliuamzn/airflow
177dfbd12a42a5c229640c6c830f43f280ea5caa
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
2
2021-07-30T16:52:00.000Z
2021-08-03T13:52:01.000Z
airflow/utils/helpers.py
rliuamzn/airflow
177dfbd12a42a5c229640c6c830f43f280ea5caa
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
36
2021-11-26T00:08:49.000Z
2021-11-26T00:09:33.000Z
airflow/utils/helpers.py
rliuamzn/airflow
177dfbd12a42a5c229640c6c830f43f280ea5caa
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
3
2020-06-30T02:38:17.000Z
2022-01-19T06:14:08.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
32.26484
108
0.675913
import re import warnings from datetime import datetime from functools import reduce from itertools import filterfalse, tee from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, TypeVar from urllib import parse from flask import url_for from jinja2 import Template from airflow...
true
true
f74a018d8f275b4d2c29a556b8436ea23679ac7e
4,868
py
Python
python3-virtualenv/lib/python3.8/site-packages/setuptools/glob.py
bbalkaransingh23888/OrientationHack
7eae6cce1226112c000ea8a175f6dc5a82ee0ac2
[ "MIT" ]
null
null
null
python3-virtualenv/lib/python3.8/site-packages/setuptools/glob.py
bbalkaransingh23888/OrientationHack
7eae6cce1226112c000ea8a175f6dc5a82ee0ac2
[ "MIT" ]
null
null
null
python3-virtualenv/lib/python3.8/site-packages/setuptools/glob.py
bbalkaransingh23888/OrientationHack
7eae6cce1226112c000ea8a175f6dc5a82ee0ac2
[ "MIT" ]
null
null
null
""" Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. """ import os import re import fnmatch __all__ = ["glob", "iglob", "escape"] def glob(pathname, recursive=False): """Return a list of paths matching...
29.149701
78
0.648726
import os import re import fnmatch __all__ = ["glob", "iglob", "escape"] def glob(pathname, recursive=False): return list(iglob(pathname, recursive=recursive)) def iglob(pathname, recursive=False): it = _iglob(pathname, recursive) if recursive and _isrecursive(pathname): s = next(it) ...
true
true
f74a02e3cafb36a65a38578239fdd869e936a956
2,868
py
Python
src/option_select_impl.py
kngwyu/infomax-option-critic
9d907c041c1d0280db9b23eb2fdf9e0033e33bf3
[ "Apache-2.0" ]
2
2021-01-24T05:29:18.000Z
2021-09-19T09:27:49.000Z
src/option_select_impl.py
kngwyu/infomax-option-critic
9d907c041c1d0280db9b23eb2fdf9e0033e33bf3
[ "Apache-2.0" ]
null
null
null
src/option_select_impl.py
kngwyu/infomax-option-critic
9d907c041c1d0280db9b23eb2fdf9e0033e33bf3
[ "Apache-2.0" ]
null
null
null
""" Implemenation of uncertainty-aware option selection """ from abc import ABC, abstractmethod from typing import Tuple import torch from torch import BoolTensor, LongTensor, Tensor from torch.distributions import Categorical from rainy.net.policy import BernoulliPolicy def _debug_minmax(name: str, t: Tensor) -...
36.769231
86
0.663529
from abc import ABC, abstractmethod from typing import Tuple import torch from torch import BoolTensor, LongTensor, Tensor from torch.distributions import Categorical from rainy.net.policy import BernoulliPolicy def _debug_minmax(name: str, t: Tensor) -> None: print(f"{name}: {t.max().item()}, {t.min().item(...
true
true
f74a0463456c097a39b520a2ecacfccc4d2e929e
1,772
py
Python
controllers/test/TestController.py
muhammetbolat/pythondataintegrator
5b274db8d39ca1340d535a500f04f6e734f1d54d
[ "MIT" ]
null
null
null
controllers/test/TestController.py
muhammetbolat/pythondataintegrator
5b274db8d39ca1340d535a500f04f6e734f1d54d
[ "MIT" ]
null
null
null
controllers/test/TestController.py
muhammetbolat/pythondataintegrator
5b274db8d39ca1340d535a500f04f6e734f1d54d
[ "MIT" ]
null
null
null
from flask import request from injector import inject from controllers.common.models.CommonModels import CommonModels from controllers.test.models.TestModels import TestModels from infrastructor.IocManager import IocManager from infrastructor.api.ResourceBase import ResourceBase @TestModels.ns.route('/path/<int:value...
38.521739
83
0.707675
from flask import request from injector import inject from controllers.common.models.CommonModels import CommonModels from controllers.test.models.TestModels import TestModels from infrastructor.IocManager import IocManager from infrastructor.api.ResourceBase import ResourceBase @TestModels.ns.route('/path/<int:value...
true
true
f74a047d44677e676e34b68720da44946d1a04bb
5,560
py
Python
spark3/main.py
tellery/blockchain-spark
f45962f6837c6c7736b881a65c1b7f2a4eee627a
[ "MIT" ]
15
2022-03-11T02:54:22.000Z
2022-03-21T20:28:16.000Z
spark3/main.py
datawaves-xyz/blockchain-spark
f45962f6837c6c7736b881a65c1b7f2a4eee627a
[ "MIT" ]
3
2022-03-14T03:09:48.000Z
2022-03-24T04:18:55.000Z
spark3/main.py
datawaves-xyz/blockchain-spark
f45962f6837c6c7736b881a65c1b7f2a4eee627a
[ "MIT" ]
null
null
null
from typing import Optional from pyspark.sql import DataFrame, SparkSession from pyspark.sql.functions import lit, col, expr, unhex from pyspark.sql.types import StructType from spark3.ethereum.condition import Conditions from spark3.ethereum.contract import Contract from spark3.providers import IContractABIProvider,...
40.882353
125
0.642986
from typing import Optional from pyspark.sql import DataFrame, SparkSession from pyspark.sql.functions import lit, col, expr, unhex from pyspark.sql.types import StructType from spark3.ethereum.condition import Conditions from spark3.ethereum.contract import Contract from spark3.providers import IContractABIProvider,...
true
true
f74a04d2de41b48ca5d10b6c657d3704f13b150f
4,870
py
Python
kubernetes/client/models/v1beta1_token_review_status.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
kubernetes/client/models/v1beta1_token_review_status.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
kubernetes/client/models/v1beta1_token_review_status.py
craigtracey/python
177564c655c0ea3f9cf38e61ca275ef6c6256aab
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.9.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
26.612022
105
0.576386
from pprint import pformat from six import iteritems import re class V1beta1TokenReviewStatus(object): swagger_types = { 'authenticated': 'bool', 'error': 'str', 'user': 'V1beta1UserInfo' } attribute_map = { 'authenticated': 'authenticated', 'error': 'error',...
true
true
f74a05c031a2244eba4525214335a1a700a1900b
4,919
py
Python
Classical/Bandit Problem/k-armed-bandit_non_stationary.py
nathanielbunch/Nonstationary-Bandit-Problem-on-a-Quantum-Computer
af9d4f508a42790249007d5237a2c0ee8b93e30a
[ "MIT" ]
null
null
null
Classical/Bandit Problem/k-armed-bandit_non_stationary.py
nathanielbunch/Nonstationary-Bandit-Problem-on-a-Quantum-Computer
af9d4f508a42790249007d5237a2c0ee8b93e30a
[ "MIT" ]
null
null
null
Classical/Bandit Problem/k-armed-bandit_non_stationary.py
nathanielbunch/Nonstationary-Bandit-Problem-on-a-Quantum-Computer
af9d4f508a42790249007d5237a2c0ee8b93e30a
[ "MIT" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt import random import sys class KBanditProblem: def __init__(self, k, stationary=True): self.k = k self.stationary = stationary self.values = np.random.normal(loc=0.0, scale=1, size=k) self.optimal = self.values.argmax() # this ...
43.530973
128
0.595243
import numpy as np import matplotlib.pyplot as plt import random import sys class KBanditProblem: def __init__(self, k, stationary=True): self.k = k self.stationary = stationary self.values = np.random.normal(loc=0.0, scale=1, size=k) self.optimal = self.values.argmax() ...
true
true
f74a0669a8ae7cc02ebfb7934c9462b45a90aee8
3,999
py
Python
applications/tensorflow/cnns/models/resnet.py
Alwaysproblem/examples-1
9754fa63ed1931489a21ac1f5b299f945e369a5c
[ "MIT" ]
null
null
null
applications/tensorflow/cnns/models/resnet.py
Alwaysproblem/examples-1
9754fa63ed1931489a21ac1f5b299f945e369a5c
[ "MIT" ]
null
null
null
applications/tensorflow/cnns/models/resnet.py
Alwaysproblem/examples-1
9754fa63ed1931489a21ac1f5b299f945e369a5c
[ "MIT" ]
null
null
null
# Copyright (c) 2019 Graphcore Ltd. All rights reserved. # # 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 l...
39.205882
101
0.596649
from models.resnet_base import ResNet import tensorflow.compat.v1 as tf import tensorflow.contrib as contrib from tensorflow.python.ipu import normalization_ops class TensorflowResNet(ResNet): def __init__(self, *args, **kwargs): self.dtype = tf.float16 super(TensorflowResNet, sel...
true
true
f74a06a8dd047f8bf4b5b065525b3ff4e303033e
20,895
py
Python
sdk/python/pulumi_google_native/cloudresourcemanager/v2/folder_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
44
2021-04-18T23:00:48.000Z
2022-02-14T17:43:15.000Z
sdk/python/pulumi_google_native/cloudresourcemanager/v2/folder_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
354
2021-04-16T16:48:39.000Z
2022-03-31T17:16:39.000Z
sdk/python/pulumi_google_native/cloudresourcemanager/v2/folder_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
8
2021-04-24T17:46:51.000Z
2022-01-05T10:40:21.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
82.916667
1,118
0.710983
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ._enums import * from ._inputs import * __all__ = ['FolderIamPolicyArgs', 'FolderIamPolicy'] @pulumi.input_type class FolderIamPolicyArgs: ...
true
true
f74a074bbe63ac9865e039f54cf1e8cab3493a78
2,245
py
Python
tests/util/test_color.py
davidedmundson/home-assistant
cd02563552ffc28239fa17c79a5d9bc0013bd5ac
[ "MIT" ]
null
null
null
tests/util/test_color.py
davidedmundson/home-assistant
cd02563552ffc28239fa17c79a5d9bc0013bd5ac
[ "MIT" ]
null
null
null
tests/util/test_color.py
davidedmundson/home-assistant
cd02563552ffc28239fa17c79a5d9bc0013bd5ac
[ "MIT" ]
1
2018-11-20T17:44:08.000Z
2018-11-20T17:44:08.000Z
"""Tests Home Assistant color util methods.""" import unittest import homeassistant.util.color as color_util class TestColorUtil(unittest.TestCase): """Test color util methods.""" # pylint: disable=invalid-name def test_color_RGB_to_xy(self): """Test color_RGB_to_xy.""" self.assertEqual((...
37.416667
78
0.588419
import unittest import homeassistant.util.color as color_util class TestColorUtil(unittest.TestCase): def test_color_RGB_to_xy(self): self.assertEqual((0, 0), color_util.color_RGB_to_xy(0, 0, 0)) self.assertEqual((0.3127159072215825, 0.3290014805066623), color_util.c...
true
true
f74a077635c4c66e783d49ad840f77d4bc298dd3
1,327
py
Python
utils/auth_timing.py
Emiliano978/twarc
36c225228522e7c67de003638c74ecf4878f3a12
[ "MIT" ]
1,011
2016-10-30T00:04:17.000Z
2022-03-31T20:55:03.000Z
utils/auth_timing.py
johnchristotle/twarc
eb0ced88ef33a48d2f2be0b3c7a015bb760b8f84
[ "MIT" ]
455
2016-11-10T16:33:13.000Z
2022-03-30T18:35:30.000Z
utils/auth_timing.py
johnchristotle/twarc
eb0ced88ef33a48d2f2be0b3c7a015bb760b8f84
[ "MIT" ]
222
2016-10-28T12:55:29.000Z
2022-03-28T06:13:29.000Z
#!/usr/bin/env python3 """ Twitter's rate limits allow App Auth contexts to search at 450 requests every 15 minutes, and User Auth contexts at 180 requests per 15 minutes. This script exercises both contexts and counts how tweets it is able to receive. We should see a significant number more tweets coming back for A...
26.019608
79
0.691786
import logging from twarc import Twarc from datetime import datetime from datetime import timedelta logging.basicConfig( filename="time_test.log", level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s", ) def count_tweets(app_auth): count = 0 t = Twarc(app_auth=app_auth) start ...
true
true
f74a09d152ade455f126d6744e95433f7ca363c0
6,021
py
Python
src/app_a.py
filangel/Eigenfaces
55ddb705611ee351cc856d5a927a4dc82acaff03
[ "MIT" ]
null
null
null
src/app_a.py
filangel/Eigenfaces
55ddb705611ee351cc856d5a927a4dc82acaff03
[ "MIT" ]
null
null
null
src/app_a.py
filangel/Eigenfaces
55ddb705611ee351cc856d5a927a4dc82acaff03
[ "MIT" ]
2
2018-10-23T11:44:43.000Z
2020-12-01T21:08:19.000Z
# matplotlib backtest for missing $DISPLAY import matplotlib matplotlib.use('Agg') # scientific computing library import numpy as np # visualization tools import matplotlib.pyplot as plt import seaborn as sns # prettify plots plt.rcParams['figure.figsize'] = [8.0, 6.0] sns.set_palette(sns.color_palette("muted")) sns...
30.876923
115
0.627304
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt import seaborn as sns plt.rcParams['figure.figsize'] = [8.0, 6.0] sns.set_palette(sns.color_palette("muted")) sns.set_style("ticks") sns_b, sns_g, sns_r, sns_v, sns_y, sns_l = sns.color_palette("muted") from reader impo...
true
true
f74a0a3849831139be52a661a1a480bad8edfa8b
863
py
Python
api/models/nutrition.py
syth0le/async_cookeat
0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8
[ "CC0-1.0" ]
null
null
null
api/models/nutrition.py
syth0le/async_cookeat
0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8
[ "CC0-1.0" ]
null
null
null
api/models/nutrition.py
syth0le/async_cookeat
0cecdd44c064be6fe19c0d0ae8342d7baf5a9bb8
[ "CC0-1.0" ]
null
null
null
from sqlalchemy import Column, Integer, String, Enum as PgEnum, Float from enum import Enum from sqlalchemy.orm import relationship from api.utils.db_init import Base class Influence(Enum): bad = "bad" neutral = "neutral" good = "good" class Nutrition(Base): __tablename__ = 'nutrition' id = Co...
30.821429
102
0.7219
from sqlalchemy import Column, Integer, String, Enum as PgEnum, Float from enum import Enum from sqlalchemy.orm import relationship from api.utils.db_init import Base class Influence(Enum): bad = "bad" neutral = "neutral" good = "good" class Nutrition(Base): __tablename__ = 'nutrition' id = Co...
true
true
f74a0d6a0a907d2bf62d5a78c007ae3b4215c12c
7,569
py
Python
vk_bot_ver.2/vk_bot.py
ehremut/v_bot
d8767136bd44eda5844a47a4ce0e848e40f10f87
[ "MIT" ]
5
2020-04-19T20:12:49.000Z
2022-02-10T18:39:29.000Z
vk_bot_ver.2/vk_bot.py
ehremut/v_bot
d8767136bd44eda5844a47a4ce0e848e40f10f87
[ "MIT" ]
null
null
null
vk_bot_ver.2/vk_bot.py
ehremut/v_bot
d8767136bd44eda5844a47a4ce0e848e40f10f87
[ "MIT" ]
null
null
null
from pymongo import MongoClient import random from datetime import datetime random.seed(datetime.now()) class VkBot(): def __init__(self, user_id): print("Создан объект бота!") self.user_id = user_id self.send = {'lang': '', 'level': '', 'format': '', 'discus': ''} self.steps = {1...
50.798658
116
0.493328
from pymongo import MongoClient import random from datetime import datetime random.seed(datetime.now()) class VkBot(): def __init__(self, user_id): print("Создан объект бота!") self.user_id = user_id self.send = {'lang': '', 'level': '', 'format': '', 'discus': ''} self.steps = {1...
true
true
f74a0d882ba7ef9d6877e0270ea00e81a108dd44
2,665
py
Python
maximum_gradient.py
kstepani/GEOG5990MAssessment2
d584c2edfab63af9b2ae7644e046ee0611a405ff
[ "MIT" ]
null
null
null
maximum_gradient.py
kstepani/GEOG5990MAssessment2
d584c2edfab63af9b2ae7644e046ee0611a405ff
[ "MIT" ]
null
null
null
maximum_gradient.py
kstepani/GEOG5990MAssessment2
d584c2edfab63af9b2ae7644e046ee0611a405ff
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ This is a program reading a raster dataset of the heights of a hilly area. It then calculates the maximum slope in all the raster cells using the "D8" algorithm and displays the heights as well as the maximum gradients as images. It finally creates an output txt file containing the calculat...
29.611111
151
0.720826
import matplotlib.pyplot import maxgradientframework print("Step 1:Pull in the heights from a txt file") with open("snow.slope.txt") as f: heights = [] for line in f: parsed_line = str.split(line," ") heights_line = [] for word in parsed_line: heights_line.append(int(wor...
true
true
f74a0e68e1d1745031c3bd19a6a4b5b54365ce8a
153
py
Python
Sets/set.symmetric_difference()_operation.py
aydinsimsek/HackerRank-solutions-python
ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134
[ "MIT" ]
null
null
null
Sets/set.symmetric_difference()_operation.py
aydinsimsek/HackerRank-solutions-python
ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134
[ "MIT" ]
null
null
null
Sets/set.symmetric_difference()_operation.py
aydinsimsek/HackerRank-solutions-python
ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134
[ "MIT" ]
null
null
null
n = int(input()) en = set(map(int, input().split())) b = int(input()) fr = set(map(int, input().split())) print(len(en.symmetric_difference(fr)))
25.5
41
0.601307
n = int(input()) en = set(map(int, input().split())) b = int(input()) fr = set(map(int, input().split())) print(len(en.symmetric_difference(fr)))
true
true
f74a0ec1f8257a2657020beaafd803597793b931
95
py
Python
etl_day_ahead_forecasting/utils/__init__.py
KamilMaziarz/etl-day-ahead-forecasting
e709336c2bc381b9909076fcc9d4dd6e81a74b72
[ "MIT" ]
null
null
null
etl_day_ahead_forecasting/utils/__init__.py
KamilMaziarz/etl-day-ahead-forecasting
e709336c2bc381b9909076fcc9d4dd6e81a74b72
[ "MIT" ]
null
null
null
etl_day_ahead_forecasting/utils/__init__.py
KamilMaziarz/etl-day-ahead-forecasting
e709336c2bc381b9909076fcc9d4dd6e81a74b72
[ "MIT" ]
null
null
null
from .paths import get_backup_path, get_resources_path from .logging import initialize_logging
31.666667
54
0.873684
from .paths import get_backup_path, get_resources_path from .logging import initialize_logging
true
true
f74a0f2cb1ff03af612ec568ffe69a9ba706938c
17,382
py
Python
tfmiss/text/wordpiecelib.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2019-06-25T15:58:20.000Z
2019-06-25T15:58:20.000Z
tfmiss/text/wordpiecelib.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2021-11-11T12:56:51.000Z
2021-11-11T12:56:51.000Z
tfmiss/text/wordpiecelib.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
2
2020-02-11T15:46:58.000Z
2021-11-21T02:47:36.000Z
# Taken from https://raw.githubusercontent.com/tensorflow/text/v2.5.0/tensorflow_text/tools/wordpiece_vocab/wordpiece_tokenizer_learner_lib.py # # coding=utf-8 # Copyright 2021 TF.Text Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
36.982979
142
0.649005
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import numpy as np from typing import List, Optional Params = collections.namedtuple('Params', [ 'upper_thresh', 'lower_thresh', 'num_iterations', 'max_input_tokens', ...
true
true
f74a101b85304fe79f2443aea2d4b253b2c3fa0f
396
py
Python
todoapp/venv/Scripts/pip-script.py
youngkhalid/todo-App
5785145535ef1370ec43f67f63c50a00edb44897
[ "MIT" ]
null
null
null
todoapp/venv/Scripts/pip-script.py
youngkhalid/todo-App
5785145535ef1370ec43f67f63c50a00edb44897
[ "MIT" ]
null
null
null
todoapp/venv/Scripts/pip-script.py
youngkhalid/todo-App
5785145535ef1370ec43f67f63c50a00edb44897
[ "MIT" ]
null
null
null
#!C:\Users\Public\todoapp\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip' __requires__ = 'pip==10.0.1' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit...
30.461538
69
0.659091
__requires__ = 'pip==10.0.1' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('pip==10.0.1', 'console_scripts', 'pip')() )
true
true
f74a1196d8892e06f484fd3396b545e33f3cb845
10,719
py
Python
src/test/balance/examples/pgu/gui/slider.py
chrisspen/homebot
cd1a5a2bddcb90d50a00e67b94297942827fbc61
[ "MIT" ]
8
2017-11-19T01:42:59.000Z
2021-02-08T09:18:58.000Z
src/test/balance/examples/pgu/gui/slider.py
chrisspen/homebot
cd1a5a2bddcb90d50a00e67b94297942827fbc61
[ "MIT" ]
24
2017-02-14T16:50:02.000Z
2017-06-07T18:38:20.000Z
src/test/balance/examples/pgu/gui/slider.py
chrisspen/homebot
cd1a5a2bddcb90d50a00e67b94297942827fbc61
[ "MIT" ]
6
2017-05-17T03:07:05.000Z
2019-11-14T09:33:06.000Z
import pygame from pygame.locals import * from .const import * from . import widget from . import table from . import basic from . import pguglobals _SLIDER_HORIZONTAL = 0 _SLIDER_VERTICAL = 1 class _slider(widget.Widget): _value = None def __init__(self,value,orient,min,max,size,step=1,**params): p...
32.383686
101
0.56759
import pygame from pygame.locals import * from .const import * from . import widget from . import table from . import basic from . import pguglobals _SLIDER_HORIZONTAL = 0 _SLIDER_VERTICAL = 1 class _slider(widget.Widget): _value = None def __init__(self,value,orient,min,max,size,step=1,**params): p...
true
true
f74a12282827d1a5716fa0134e987fab7c711448
1,279
py
Python
nipype/interfaces/afni/tests/test_auto_TCat.py
mfalkiewicz/nipype
775e21b78fb1ffa2ff9cb12e6f052868bd44d052
[ "Apache-2.0" ]
null
null
null
nipype/interfaces/afni/tests/test_auto_TCat.py
mfalkiewicz/nipype
775e21b78fb1ffa2ff9cb12e6f052868bd44d052
[ "Apache-2.0" ]
null
null
null
nipype/interfaces/afni/tests/test_auto_TCat.py
mfalkiewicz/nipype
775e21b78fb1ffa2ff9cb12e6f052868bd44d052
[ "Apache-2.0" ]
null
null
null
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..utils import TCat def test_TCat_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(deprecated='1.0.0', nohash=True, ...
24.132075
67
0.625489
from __future__ import unicode_literals from ..utils import TCat def test_TCat_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(deprecated='1.0.0', nohash=True, usedefault=True, ), in_files=dict(argstr=' %...
true
true
f74a123e35581b97a2396e4b92e77585eeb2435f
15,061
py
Python
tests/ignitor/web/restapi_test.py
samuelbaizg/ssguan
97def0609d61e40472554464470758b5fb9eca35
[ "Apache-2.0" ]
1
2015-07-14T14:24:05.000Z
2015-07-14T14:24:05.000Z
tests/ignitor/web/restapi_test.py
samuelbaizg/ssguan
97def0609d61e40472554464470758b5fb9eca35
[ "Apache-2.0" ]
null
null
null
tests/ignitor/web/restapi_test.py
samuelbaizg/ssguan
97def0609d61e40472554464470758b5fb9eca35
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2015 www.suishouguan.com # # Licensed under the Private License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://github.com/samuelbaizg/ssguan/blob/master/LICENSE # # Unless ...
48.899351
169
0.600159
from ssguan.ignitor.auth import service as auth_service from ssguan.ignitor.auth.model import Role from ssguan.ignitor.orm import properti from ssguan.ignitor.orm.model import Model from ssguan.ignitor.utility import crypt, kind from ssguan.ignitor.web import config as web_config from ssguan.ig...
true
true
f74a12cae48af49fe5240e959e3f01660e1a6f54
2,296
py
Python
alphapose/utils/registry.py
ericwang0701/AlphaPose
1f17dbf4b41ad7452430b69f72d58a0585ed09af
[ "Apache-2.0" ]
287
2020-11-30T12:45:20.000Z
2022-03-31T16:03:45.000Z
alphapose/utils/registry.py
ericwang0701/AlphaPose
1f17dbf4b41ad7452430b69f72d58a0585ed09af
[ "Apache-2.0" ]
62
2021-01-08T02:06:47.000Z
2022-03-15T11:55:58.000Z
alphapose/utils/registry.py
ericwang0701/AlphaPose
1f17dbf4b41ad7452430b69f72d58a0585ed09af
[ "Apache-2.0" ]
30
2021-03-04T07:18:03.000Z
2022-03-09T06:06:28.000Z
import inspect class Registry(object): def __init__(self, name): self._name = name self._module_dict = dict() def __repr__(self): format_str = self.__class__.__name__ + '(name={}, items={})'.format( self._name, list(self._module_dict.keys())) return format_str ...
30.210526
78
0.616725
import inspect class Registry(object): def __init__(self, name): self._name = name self._module_dict = dict() def __repr__(self): format_str = self.__class__.__name__ + '(name={}, items={})'.format( self._name, list(self._module_dict.keys())) return format_str ...
true
true
f74a149298a245a15bae235ff4aa51a6415f7270
1,543
py
Python
tools/jsrun.py
apportable/emscripten
6960d2296299e96d43e694806f5d35799ef8d39c
[ "MIT" ]
2
2015-06-26T22:32:16.000Z
2020-01-14T13:30:18.000Z
tools/jsrun.py
sunfishcode/emscripten
53af8ab2ebc91488d53e27dd69f7c8b8901cbda5
[ "MIT" ]
null
null
null
tools/jsrun.py
sunfishcode/emscripten
53af8ab2ebc91488d53e27dd69f7c8b8901cbda5
[ "MIT" ]
1
2018-11-17T14:39:42.000Z
2018-11-17T14:39:42.000Z
import time, os, sys, logging from subprocess import Popen, PIPE, STDOUT TRACK_PROCESS_SPAWNS = True if (os.getenv('EM_BUILD_VERBOSE') and int(os.getenv('EM_BUILD_VERBOSE')) >= 3) else False def timeout_run(proc, timeout=None, note='unnamed process', full_output=False): start = time.time() if timeout is not None:...
40.605263
156
0.661698
import time, os, sys, logging from subprocess import Popen, PIPE, STDOUT TRACK_PROCESS_SPAWNS = True if (os.getenv('EM_BUILD_VERBOSE') and int(os.getenv('EM_BUILD_VERBOSE')) >= 3) else False def timeout_run(proc, timeout=None, note='unnamed process', full_output=False): start = time.time() if timeout is not None:...
true
true
f74a1534fb3eab5465f95d8cc3598525f9f3fa0d
1,333
py
Python
configs/_base_/models/deeplabv3plus_r50-d8.py
sandylaker/mmsegmentation
1c96a89472804a1e7d4c4cbe8cd980617345d6c9
[ "Apache-2.0" ]
789
2020-12-30T10:20:37.000Z
2022-03-30T15:09:13.000Z
configs/_base_/models/deeplabv3plus_r50-d8.py
JPLAY0/mmsegmentation
b46bbfdeed127b1cab325f707c090014f9333c11
[ "Apache-2.0" ]
51
2021-01-01T11:21:13.000Z
2022-03-31T01:16:26.000Z
configs/_base_/models/deeplabv3plus_r50-d8.py
JPLAY0/mmsegmentation
b46bbfdeed127b1cab325f707c090014f9333c11
[ "Apache-2.0" ]
119
2021-01-02T14:27:41.000Z
2022-03-30T06:07:29.000Z
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict( type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), strides=...
28.361702
74
0.591898
norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict( type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), strides=(1, 2, 1, 1), ...
true
true
f74a16c910af94f26937f69a728a16e98e9bf5d1
2,826
py
Python
pysb/export/pysb_flat.py
FFroehlich/pysb
8595a4d878181b9bbf11124e008eab7cd78cf7ae
[ "BSD-2-Clause" ]
1
2019-10-23T16:29:29.000Z
2019-10-23T16:29:29.000Z
pysb/export/pysb_flat.py
zhwycsz/pysb
d1afd8bed83cc09476ea871ffcc106b18498dc7f
[ "BSD-2-Clause" ]
null
null
null
pysb/export/pysb_flat.py
zhwycsz/pysb
d1afd8bed83cc09476ea871ffcc106b18498dc7f
[ "BSD-2-Clause" ]
null
null
null
""" A module containing a class that exports a PySB model to a single Python source file that, when imported, will recreate the same model. This is intended for saving a dynamically generated model so that it can be reused without re-running the dynamic generation process. Note that any macro calls and other program st...
33.642857
80
0.642604
import pysb from pysb.export import Exporter try: from cStringIO import StringIO except ImportError: from io import StringIO class PysbFlatExporter(Exporter): def export(self): output = StringIO() def write_cset(cset): for c in cset: output.write(rep...
true
true
f74a182c1a9fdce2a57fc5920f4802f00a4cb4b3
361
py
Python
new 2.py
yadavaman377/psychic-train
cd1faff07db07cf2682dbbc8ca0b1135448c8ff4
[ "Apache-2.0" ]
null
null
null
new 2.py
yadavaman377/psychic-train
cd1faff07db07cf2682dbbc8ca0b1135448c8ff4
[ "Apache-2.0" ]
null
null
null
new 2.py
yadavaman377/psychic-train
cd1faff07db07cf2682dbbc8ca0b1135448c8ff4
[ "Apache-2.0" ]
null
null
null
def maximum_consecutive(lst, n): count = 0 result = 0 for i in range(0, n): if (lst[i] == 0): count = 0 else: count+= 1 result = max(result, count) return result lst=[0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1] n=len(lst...
20.055556
48
0.457064
def maximum_consecutive(lst, n): count = 0 result = 0 for i in range(0, n): if (lst[i] == 0): count = 0 else: count+= 1 result = max(result, count) return result lst=[0,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1] n=len(lst...
true
true
f74a1971c7c1c841c0e5e093e9c0b62a0578e932
446
py
Python
orders/admin.py
gabrieldatascience/DjangoEcomerce
e21668cb4a96613c218a854770cb61bf30390a0f
[ "Apache-2.0" ]
null
null
null
orders/admin.py
gabrieldatascience/DjangoEcomerce
e21668cb4a96613c218a854770cb61bf30390a0f
[ "Apache-2.0" ]
null
null
null
orders/admin.py
gabrieldatascience/DjangoEcomerce
e21668cb4a96613c218a854770cb61bf30390a0f
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import Order, OrderItem class OrderItemInline(admin.TabularInline): model = OrderItem raw_id_fields = ['product'] class OrderAdmin(admin.ModelAdmin): list_display = ['id', 'first_name', 'last_name', 'email', 'address', 'postal_code', 'city', 'paid', 'created', '...
24.777778
111
0.719731
from django.contrib import admin from .models import Order, OrderItem class OrderItemInline(admin.TabularInline): model = OrderItem raw_id_fields = ['product'] class OrderAdmin(admin.ModelAdmin): list_display = ['id', 'first_name', 'last_name', 'email', 'address', 'postal_code', 'city', 'paid', 'created', '...
true
true
f74a19d79b163eb52033a1b8e64d27f3ad642748
12,732
py
Python
opensfm/config.py
m-abdulhak/OpenSfM
7b29b9eecfd0919466dac88b7f34c4a635afbf22
[ "BSD-2-Clause" ]
1
2020-11-18T03:14:45.000Z
2020-11-18T03:14:45.000Z
opensfm/config.py
popweize/OpenSfM
767756c2c2f35a2d081a03dffdaa0ba21400a89e
[ "BSD-2-Clause" ]
null
null
null
opensfm/config.py
popweize/OpenSfM
767756c2c2f35a2d081a03dffdaa0ba21400a89e
[ "BSD-2-Clause" ]
null
null
null
import os import yaml default_config_yaml = """ # Metadata use_exif_size: yes default_focal_prior: 0.85 # Params for features feature_type: HAHOG # Feature type (AKAZE, SURF, SIFT, HAHOG, ORB) feature_root: 1 # If 1, apply square root mapping to features feature_min_frames...
66.3125
213
0.745287
import os import yaml default_config_yaml = """ # Metadata use_exif_size: yes default_focal_prior: 0.85 # Params for features feature_type: HAHOG # Feature type (AKAZE, SURF, SIFT, HAHOG, ORB) feature_root: 1 # If 1, apply square root mapping to features feature_min_frames...
true
true
f74a1a795ba2035cc35513d7143cafeb4fc39196
2,064
py
Python
scripts/make_predictions.py
abhi12ravi/iwpa
6d93012421c046a2a32fc5d78ea647977cfb355f
[ "MIT" ]
null
null
null
scripts/make_predictions.py
abhi12ravi/iwpa
6d93012421c046a2a32fc5d78ea647977cfb355f
[ "MIT" ]
2
2021-09-14T10:58:40.000Z
2021-09-14T10:59:39.000Z
scripts/make_predictions.py
abhi12ravi/iwppa
ebe133412b7ef24453e090b6b44d8d78a540c384
[ "MIT" ]
null
null
null
import lazypredict import sys import numpy as np np.set_printoptions(threshold=sys.maxsize) #Read data file import pandas as pd filepath = "dataset/trial_1200/balanced_dataset2.csv" df = pd.read_csv(filepath) features = df # Labels are the values we want to predict labels = np.array(df['protection_level']) # Remov...
30.80597
137
0.763081
import lazypredict import sys import numpy as np np.set_printoptions(threshold=sys.maxsize) import pandas as pd filepath = "dataset/trial_1200/balanced_dataset2.csv" df = pd.read_csv(filepath) features = df labels = np.array(df['protection_level']) features = features.drop('protection_level', axis = 1) features...
true
true
f74a1a7a08c225ce0a20fb04fc8b3952f784bcb9
2,391
py
Python
Lib/test/test_macfs.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/test/test_macfs.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/test/test_macfs.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
# Copyright (C) 2003 Python Software Foundation import unittest import warnings warnings.filterwarnings("ignore", "macfs.*", DeprecationWarning, __name__) import macfs import os import sys import tempfile from test import test_support class TestMacfs(unittest.TestCase): def setUp(self): fp ...
30.265823
87
0.628607
import unittest import warnings warnings.filterwarnings("ignore", "macfs.*", DeprecationWarning, __name__) import macfs import os import sys import tempfile from test import test_support class TestMacfs(unittest.TestCase): def setUp(self): fp = open(test_support.TESTFN, 'w') fp.wri...
true
true
f74a1a9a3c72ab8cc547b13e5961a1c589cb46db
974
py
Python
examples/lineChartXY.py
oz123/python-nvd3
fd4998549542343b74b82ca72cbcee97845b06ee
[ "MIT" ]
442
2015-01-12T10:13:52.000Z
2022-01-11T15:18:48.000Z
examples/lineChartXY.py
oz123/python-nvd3
fd4998549542343b74b82ca72cbcee97845b06ee
[ "MIT" ]
106
2015-01-11T20:27:50.000Z
2021-11-05T17:18:15.000Z
examples/lineChartXY.py
oz123/python-nvd3
fd4998549542343b74b82ca72cbcee97845b06ee
[ "MIT" ]
161
2015-01-06T13:31:18.000Z
2022-03-09T05:22:30.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- """ Examples for Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from nvd3 imp...
26.324324
91
0.646817
from nvd3 import lineChart from numpy import sin, pi, linspace output_file = open('test_lineChartXY.html', 'w') type = "lineChart" chart = lineChart(name=type, x_is_date=False, x_axis_format=".1f", y_axis_format=".1f", width=500, height=500, show_legend=False)...
true
true
f74a1acf8fd87b7d0428cfd522f234fac101f0d3
3,747
py
Python
mqrepl/mqlogger.py
tve/mpy-mqtt
98bcdd0c3bf3d301cdc039f88f5c4b851cf1bc66
[ "MIT" ]
80
2020-05-26T08:15:43.000Z
2022-03-24T11:01:41.000Z
mqrepl/mqlogger.py
tve/mpy-mqtt
98bcdd0c3bf3d301cdc039f88f5c4b851cf1bc66
[ "MIT" ]
19
2020-05-26T07:49:43.000Z
2021-07-27T23:33:10.000Z
mqrepl/mqlogger.py
tve/mpy-mqtt
98bcdd0c3bf3d301cdc039f88f5c4b851cf1bc66
[ "MIT" ]
13
2020-06-22T17:40:43.000Z
2021-07-27T19:23:20.000Z
# MQTT Logger for MicroPython by Thorsten von Eicken (c) 2020 # # Requires mqtt_async for asyncio-based MQTT. #!!!!!!!!!! This code was pulled out of mqrepl and is not finished. It's probably better to #!!!!!!!!!! hook Logging and make sure all errors and exceptions result in calls to Logging. #!!!!!!!!!! This way ver...
36.378641
98
0.60822
#!!!!!!!!!! hook Logging and make sure all errors and exceptions result in calls to Logging. #!!!!!!!!!! This way verbosity can be controlled and the line oriented nature makes it easier #!!!!!!!!!! to parse. import io, os import uasyncio as asyncio from uasyncio import Loop import logging log = logging.getLogger...
true
true
f74a1bf085046e18ee77598994dae58d97f73cd0
4,991
py
Python
gpflow/_settings.py
marctom/GPflow
649b039b685e2c158bdaac3ecd8c2ad3ee18bc8f
[ "Apache-2.0" ]
1
2020-01-27T19:05:28.000Z
2020-01-27T19:05:28.000Z
gpflow/_settings.py
marctom/GPflow
649b039b685e2c158bdaac3ecd8c2ad3ee18bc8f
[ "Apache-2.0" ]
null
null
null
gpflow/_settings.py
marctom/GPflow
649b039b685e2c158bdaac3ecd8c2ad3ee18bc8f
[ "Apache-2.0" ]
null
null
null
import os import copy import collections import warnings import logging import inspect from collections import OrderedDict import configparser import numpy as np import tensorflow as tf class _SettingsContextManager(object): def __init__(self, manager, tmp_settings): self._manager = manager sel...
28.19774
80
0.635945
import os import copy import collections import warnings import logging import inspect from collections import OrderedDict import configparser import numpy as np import tensorflow as tf class _SettingsContextManager(object): def __init__(self, manager, tmp_settings): self._manager = manager sel...
true
true
f74a1d08e0902583b5cd19cd039aea131ec0c4a4
5,506
py
Python
jenkinsapi_utils/jenkins_launcher.py
ifwe/jenkinsapi
31a7fbb07efcd48e226f7dcf643fd2a2625416c0
[ "MIT" ]
1
2015-01-12T14:15:59.000Z
2015-01-12T14:15:59.000Z
jenkinsapi_utils/jenkins_launcher.py
moustuk/jenkinsapi-1
d18c1e669965c209093763f3295f79c9d3ccdeea
[ "MIT" ]
null
null
null
jenkinsapi_utils/jenkins_launcher.py
moustuk/jenkinsapi-1
d18c1e669965c209093763f3295f79c9d3ccdeea
[ "MIT" ]
null
null
null
import os import time import Queue import random import shutil import logging import datetime import tempfile import requests import threading import subprocess import pkg_resources from jenkinsapi.jenkins import Jenkins from jenkinsapi.custom_exceptions import JenkinsAPIException log = logging.getLogger(__name__) ...
30.087432
96
0.599346
import os import time import Queue import random import shutil import logging import datetime import tempfile import requests import threading import subprocess import pkg_resources from jenkinsapi.jenkins import Jenkins from jenkinsapi.custom_exceptions import JenkinsAPIException log = logging.getLogger(__name__) ...
true
true
f74a1d93fc46848fcfb9d4be44187fb3a6570e1b
662
py
Python
tests/group/test_delete_group.py
alenickwork/python_training
04300b1ff3b1a30f4f724411944ad2f67a3067f5
[ "Apache-2.0" ]
null
null
null
tests/group/test_delete_group.py
alenickwork/python_training
04300b1ff3b1a30f4f724411944ad2f67a3067f5
[ "Apache-2.0" ]
null
null
null
tests/group/test_delete_group.py
alenickwork/python_training
04300b1ff3b1a30f4f724411944ad2f67a3067f5
[ "Apache-2.0" ]
null
null
null
from model.group import Group, clean import random def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: test_group = Group() test_group.dummy() app.group.create(test_group) old_groups = db.get_group_list() group = random.choice(old_groups) app.group...
25.461538
73
0.670695
from model.group import Group, clean import random def test_delete_some_group(app, db, check_ui): if len(db.get_group_list()) == 0: test_group = Group() test_group.dummy() app.group.create(test_group) old_groups = db.get_group_list() group = random.choice(old_groups) app.group...
true
true
f74a1f06253c573af8f4b81d28f7a232ac6ab9ae
8,429
py
Python
src/perceptual_scores.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
null
null
null
src/perceptual_scores.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
9
2020-09-26T01:22:00.000Z
2022-01-22T18:00:52.000Z
src/perceptual_scores.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import os import numpy as np import tensorflow as tf from tensorflow.keras.models import Model from scipy.misc import imread from sklearn.cluster import KMeans from sklearn.decomposition.pca import PCA from tqdm import tqdm from utils import (kernel_classifier_distance_and_std_from_activations,...
56.952703
148
0.758216
import os import numpy as np import tensorflow as tf from tensorflow.keras.models import Model from scipy.misc import imread from sklearn.cluster import KMeans from sklearn.decomposition.pca import PCA from tqdm import tqdm from utils import (kernel_classifier_distance_and_std_from_activations, l...
true
true
f74a1f0a1396127a8f8d77c9e8497c428d42886c
2,766
py
Python
kube_hunter/modules/discovery/kubelet.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
1
2021-09-13T21:52:52.000Z
2021-09-13T21:52:52.000Z
kube_hunter/modules/discovery/kubelet.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
2
2021-05-20T20:17:17.000Z
2022-02-26T09:20:16.000Z
kube_hunter/modules/discovery/kubelet.py
vipulgupta2048/kube-hunter
fe3dba90d8cc6f947846e6a099a2562e7c2f88b1
[ "Apache-2.0" ]
1
2020-07-29T07:50:10.000Z
2020-07-29T07:50:10.000Z
import json import logging import requests import urllib3 from enum import Enum from kube_hunter.core.types import Discovery, Kubelet from kube_hunter.core.events import handler from kube_hunter.core.events.types import OpenPortEvent, Vulnerability, Event, Service urllib3.disable_warnings(urllib3.exceptions.Insecure...
39.514286
138
0.697397
import json import logging import requests import urllib3 from enum import Enum from kube_hunter.core.types import Discovery, Kubelet from kube_hunter.core.events import handler from kube_hunter.core.events.types import OpenPortEvent, Vulnerability, Event, Service urllib3.disable_warnings(urllib3.exceptions.Insecure...
true
true
f74a1fac72e8db0db60a9d56a40580b5da56dfdc
2,149
py
Python
tools/python/descriptions/__main__.py
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
4,879
2015-09-30T10:56:36.000Z
2022-03-31T18:43:03.000Z
tools/python/descriptions/__main__.py
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
7,549
2015-09-30T10:52:53.000Z
2022-03-31T22:04:22.000Z
tools/python/descriptions/__main__.py
smartyw/organicmaps
9b10eb9d3ed6833861cef294c2416cc98b15e10d
[ "Apache-2.0" ]
1,493
2015-09-30T10:43:06.000Z
2022-03-21T09:16:49.000Z
import argparse import itertools import logging import os import wikipediaapi from descriptions.descriptions_downloader import check_and_get_checker from descriptions.descriptions_downloader import download_from_wikidata_tags from descriptions.descriptions_downloader import download_from_wikipedia_tags from descripti...
30.7
84
0.688227
import argparse import itertools import logging import os import wikipediaapi from descriptions.descriptions_downloader import check_and_get_checker from descriptions.descriptions_downloader import download_from_wikidata_tags from descriptions.descriptions_downloader import download_from_wikipedia_tags from descripti...
true
true
f74a207d8ad9dfa591242c7ec093206515629648
12,014
py
Python
fiftyone/core/document.py
seantrue/fiftyone
75c853714d2712b8da51a5c53ae68f6c47229b06
[ "Apache-2.0" ]
null
null
null
fiftyone/core/document.py
seantrue/fiftyone
75c853714d2712b8da51a5c53ae68f6c47229b06
[ "Apache-2.0" ]
null
null
null
fiftyone/core/document.py
seantrue/fiftyone
75c853714d2712b8da51a5c53ae68f6c47229b06
[ "Apache-2.0" ]
null
null
null
""" Base class for objects that are backed by database documents. | Copyright 2017-2020, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ from copy import deepcopy import eta.core.serial as etas class Document(object): """Base class for objects that are associated with :class:`fiftyone.core.datas...
30.035
79
0.598219
from copy import deepcopy import eta.core.serial as etas class Document(object): def __init__(self, dataset=None): self._dataset = dataset def __dir__(self): return super().__dir__() + list(self.field_names) def __getattr__(self, name): try: return super().__getattr...
true
true
f74a21622409ae9fba21c08542aa3faea1cac0d7
21,667
py
Python
train_pt.py
naviocean/imgclsmob
f2993d3ce73a2f7ddba05da3891defb08547d504
[ "MIT" ]
2,649
2018-08-03T14:18:00.000Z
2022-03-31T08:08:17.000Z
train_pt.py
naviocean/imgclsmob
f2993d3ce73a2f7ddba05da3891defb08547d504
[ "MIT" ]
95
2018-08-13T01:46:03.000Z
2022-03-13T08:38:14.000Z
train_pt.py
naviocean/imgclsmob
f2993d3ce73a2f7ddba05da3891defb08547d504
[ "MIT" ]
549
2018-08-06T08:09:22.000Z
2022-03-31T08:08:21.000Z
""" Script for training model on PyTorch. """ import os import time import logging import argparse import random import numpy as np import torch.nn as nn import torch.backends.cudnn as cudnn import torch.utils.data from common.logger_utils import initialize_logging from common.train_log_param_sav...
30.516901
120
0.577145
import os import time import logging import argparse import random import numpy as np import torch.nn as nn import torch.backends.cudnn as cudnn import torch.utils.data from common.logger_utils import initialize_logging from common.train_log_param_saver import TrainLogParamSaver from pytorch.utils impo...
true
true
f74a22c77623d99cdf6cf98d19aadd9576da3f1f
1,743
py
Python
python/qipkg/actions/ls_package.py
vbarbaresi/qibuild
eab6b815fe0af49ea5c41ccddcd0dff2363410e1
[ "BSD-3-Clause" ]
null
null
null
python/qipkg/actions/ls_package.py
vbarbaresi/qibuild
eab6b815fe0af49ea5c41ccddcd0dff2363410e1
[ "BSD-3-Clause" ]
null
null
null
python/qipkg/actions/ls_package.py
vbarbaresi/qibuild
eab6b815fe0af49ea5c41ccddcd0dff2363410e1
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. """ List the contents of a package """ import zipfile import os import tabulate from qisys import ui import qisys.parsers def configure_parser(parse...
30.578947
79
0.629948
import zipfile import os import tabulate from qisys import ui import qisys.parsers def configure_parser(parser): qisys.parsers.default_parser(parser) parser.add_argument("pkg_path") parser.add_argument("--sort", "-s", default="f", action="store") parser.add_argument("--reverse", "-r", action="sto...
true
true
f74a22cb82d37a2b25432d3513f01b3faa51decd
777
py
Python
scraper.py
shauryashahi/Indian-Schools-Database
02be2e0229b819820a72642406be07b9aa77f7ea
[ "Apache-2.0" ]
null
null
null
scraper.py
shauryashahi/Indian-Schools-Database
02be2e0229b819820a72642406be07b9aa77f7ea
[ "Apache-2.0" ]
null
null
null
scraper.py
shauryashahi/Indian-Schools-Database
02be2e0229b819820a72642406be07b9aa77f7ea
[ "Apache-2.0" ]
null
null
null
from lxml.html import parse def main(): baseurl = 'http://www.schoolcolleges.com/school.select.php?offset=%s&val=city=%270%27&select=%s' states = [ 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'BIHAR', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jammu & Kashmir', 'Jharkhand', 'Ka...
18.069767
97
0.635779
from lxml.html import parse def main(): baseurl = 'http://www.schoolcolleges.com/school.select.php?offset=%s&val=city=%270%27&select=%s' states = [ 'Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'BIHAR', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jammu & Kashmir', 'Jharkhand', 'Ka...
true
true
f74a22fe350f5da0824bed9b1a5ba19ba798a127
37,492
py
Python
test/test_cudamat.py
cloudspectatordevelopment/cudamat
d26cf019a7855077b7d4344ae1a3202a156c5170
[ "BSD-3-Clause" ]
526
2015-01-05T14:33:10.000Z
2022-03-09T12:41:37.000Z
test/test_cudamat.py
cloudspectatordevelopment/cudamat
d26cf019a7855077b7d4344ae1a3202a156c5170
[ "BSD-3-Clause" ]
71
2015-01-01T01:03:09.000Z
2021-10-01T06:57:07.000Z
test/test_cudamat.py
cloudspectatordevelopment/cudamat
d26cf019a7855077b7d4344ae1a3202a156c5170
[ "BSD-3-Clause" ]
139
2015-01-13T21:23:38.000Z
2022-02-24T03:26:34.000Z
import numpy as np import nose import cudamat as cm def setup(): cm.cublas_init() def teardown(): cm.cublas_shutdown() def test_reshape(): m = 256 n = 1 cm1 = np.array(np.random.rand(n, m)*10, dtype=np.float32, order='F') cm2 = np.array(np.random.rand(m, n)*10, dtype=np.float32, order='F') ...
30.781609
143
0.614478
import numpy as np import nose import cudamat as cm def setup(): cm.cublas_init() def teardown(): cm.cublas_shutdown() def test_reshape(): m = 256 n = 1 cm1 = np.array(np.random.rand(n, m)*10, dtype=np.float32, order='F') cm2 = np.array(np.random.rand(m, n)*10, dtype=np.float32, order='F') ...
true
true
f74a23cb3368c5e3ccec08a100cc94c7ba57cd11
6,869
py
Python
bert_pytorch/dataset/vocab.py
YongWookHa/BERT-pytorch
d593f66374985be378a0b6e8133ce1c8c6e28531
[ "Apache-2.0" ]
null
null
null
bert_pytorch/dataset/vocab.py
YongWookHa/BERT-pytorch
d593f66374985be378a0b6e8133ce1c8c6e28531
[ "Apache-2.0" ]
null
null
null
bert_pytorch/dataset/vocab.py
YongWookHa/BERT-pytorch
d593f66374985be378a0b6e8133ce1c8c6e28531
[ "Apache-2.0" ]
null
null
null
import pickle import tqdm from collections import Counter class TorchVocab(object): """Defines a vocabulary object that will be used to numericalize a field. Attributes: freqs: A collections.Counter object holding the frequencies of tokens in the data used to build the Vocab. stoi:...
36.537234
93
0.60329
import pickle import tqdm from collections import Counter class TorchVocab(object): def __init__(self, counter, max_size=None, min_freq=1, specials=['<pad>', '<oov>'], vectors=None, unk_init=None, vectors_cache=None): self.freqs = counter counter = counter.copy() min_freq...
true
true
f74a24918eeb5217ecaa258080a7078fa2645839
99,629
py
Python
mmtbx/regression/model/tst_model.py
Anthchirp/cctbx
b8064f755b1dbadf05b8fbf806b7d50d73ef69bf
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/regression/model/tst_model.py
Anthchirp/cctbx
b8064f755b1dbadf05b8fbf806b7d50d73ef69bf
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/regression/model/tst_model.py
Anthchirp/cctbx
b8064f755b1dbadf05b8fbf806b7d50d73ef69bf
[ "BSD-3-Clause-LBNL" ]
null
null
null
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex import os import mmtbx.model import libtbx.load_env from six.moves import cStringIO as StringIO from libtbx.utils import format_cpu_times, null_out from libtbx.test_utils import approx_equal, show_diff import iotbx.pdb ...
65.28768
111
0.497325
from __future__ import absolute_import, division, print_function from cctbx.array_family import flex import os import mmtbx.model import libtbx.load_env from six.moves import cStringIO as StringIO from libtbx.utils import format_cpu_times, null_out from libtbx.test_utils import approx_equal, show_diff import iotbx.pdb ...
true
true
f74a25276eabbc04aee30b11c2806c6d2b732149
63,456
py
Python
tests/test_functional.py
alvistack/Pylons-waitress
c87c899dc6b9c56ff8f1fc6a674a25b1109bad85
[ "ZPL-2.1" ]
null
null
null
tests/test_functional.py
alvistack/Pylons-waitress
c87c899dc6b9c56ff8f1fc6a674a25b1109bad85
[ "ZPL-2.1" ]
null
null
null
tests/test_functional.py
alvistack/Pylons-waitress
c87c899dc6b9c56ff8f1fc6a674a25b1109bad85
[ "ZPL-2.1" ]
null
null
null
import errno from http import client as httplib import logging import multiprocessing import os import signal import socket import string import subprocess import sys import time import unittest from waitress import server from waitress.compat import WIN from waitress.utilities import cleanup_unix_socket dn = os.path...
37.659347
88
0.58888
import errno from http import client as httplib import logging import multiprocessing import os import signal import socket import string import subprocess import sys import time import unittest from waitress import server from waitress.compat import WIN from waitress.utilities import cleanup_unix_socket dn = os.path...
true
true
f74a257c63e093da6cea2f7307231a299eb3506a
123
py
Python
fuzza/transformer/__init__.py
raphlcx/fuzza
efec8e1d22093876baf1de6a03115979e44228d9
[ "MIT" ]
7
2018-10-19T03:44:08.000Z
2021-06-13T23:23:56.000Z
fuzza/transformer/__init__.py
raphlcx/fuzza
efec8e1d22093876baf1de6a03115979e44228d9
[ "MIT" ]
null
null
null
fuzza/transformer/__init__.py
raphlcx/fuzza
efec8e1d22093876baf1de6a03115979e44228d9
[ "MIT" ]
null
null
null
""" fuzza.transformer ----------------- The transformer module for data transformation. """ from .transformer import init
15.375
47
0.666667
from .transformer import init
true
true
f74a26f86c5319aef74c8b7423476c23ae6f70d8
1,997
py
Python
tests/test_monitor.py
autostack/pytest-sensor
984bf1bae54521a30719d3b757bda6c910b9566b
[ "MIT" ]
2
2015-09-27T19:46:42.000Z
2015-09-30T05:55:21.000Z
tests/test_monitor.py
autostack/pytest-sensor
984bf1bae54521a30719d3b757bda6c910b9566b
[ "MIT" ]
null
null
null
tests/test_monitor.py
autostack/pytest-sensor
984bf1bae54521a30719d3b757bda6c910b9566b
[ "MIT" ]
null
null
null
#!/usr/bin/ctx python # -*- coding: UTF-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest import time import redis from pprint import pprint as pp from sensor.constants import (TEST_CAHNNEL_ID, CONFIG) class PublishMock(object): de...
30.257576
84
0.546319
from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest import time import redis from pprint import pprint as pp from sensor.constants import (TEST_CAHNNEL_ID, CONFIG) class PublishMock(object): def __init__(self): self.q = redis.Str...
true
true
f74a285df7785990c054ccc604ba054ab849e608
4,032
py
Python
DQM/Integration/scripts/XMLcfgfiles/getRunAppsInfo.py
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
DQM/Integration/scripts/XMLcfgfiles/getRunAppsInfo.py
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
DQM/Integration/scripts/XMLcfgfiles/getRunAppsInfo.py
Purva-Chaudhari/cmssw
32e5cbfe54c4d809d60022586cf200b7c3020bcf
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#!/usr/bin/env python3 """This module provides the PID and the log file name of the running DQM applications (consumers), thus completing the information generated by ExtractAppInfoFromXML. When used as a script the following options are accepted: -f Show all columns -h show headers """ from __future__ import prin...
34.461538
105
0.509177
from __future__ import print_function import sys import os.path import getopt as gop import ExtractAppInfoFromXML as appinf
true
true
f74a2896a1d27cb39eb9be8b7f90b3a49f353807
38,296
py
Python
dbio/dss/__init__.py
DataBiosphere/data-store-cli
d83776ac68d3c6c86de1714487803bbdf705fddf
[ "MIT" ]
null
null
null
dbio/dss/__init__.py
DataBiosphere/data-store-cli
d83776ac68d3c6c86de1714487803bbdf705fddf
[ "MIT" ]
41
2020-01-13T22:19:19.000Z
2020-03-16T23:11:37.000Z
dbio/dss/__init__.py
DataBiosphere/data-store-cli
d83776ac68d3c6c86de1714487803bbdf705fddf
[ "MIT" ]
null
null
null
""" Data Storage System ******************* """ import errno import functools import json from collections import defaultdict, namedtuple import concurrent.futures from datetime import datetime from fnmatch import fnmatchcase import hashlib import os import re import tempfile import time import uuid from io import open...
49.160462
120
0.59283
import errno import functools import json from collections import defaultdict, namedtuple import concurrent.futures from datetime import datetime from fnmatch import fnmatchcase import hashlib import os import re import tempfile import time import uuid from io import open import requests from atomicwrites import atomi...
true
true
f74a289b7b4788b88050af5050044eda2804967f
7,357
py
Python
algotrade/broker/broker.py
ZhizhongPan/algo_trade
5fffa50205c0fb0dd6866872798b3844404c94bb
[ "Apache-2.0" ]
null
null
null
algotrade/broker/broker.py
ZhizhongPan/algo_trade
5fffa50205c0fb0dd6866872798b3844404c94bb
[ "Apache-2.0" ]
null
null
null
algotrade/broker/broker.py
ZhizhongPan/algo_trade
5fffa50205c0fb0dd6866872798b3844404c94bb
[ "Apache-2.0" ]
1
2020-06-19T12:10:56.000Z
2020-06-19T12:10:56.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'phil.zhang' from abc import ABCMeta, abstractmethod, abstractproperty import six from algotrade.event_engine import EventEngineMixin # class BaseBroker(six.with_metaclass(ABCMeta), EventEngineMixin): # def __init__(self): # self.event_engine ...
39.983696
146
0.672285
__author__ = 'phil.zhang' from abc import ABCMeta, abstractmethod, abstractproperty import six from algotrade.event_engine import EventEngineMixin
true
true