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
1c3ebb2ffa9845ad6f59777ce682acd6917daa3e
808
py
Python
wazimap_ng/points/services/locations.py
Faysalali534/wazimap-ng
64cff12c042167ce633658a3c45f7c142f3fd5ce
[ "Apache-2.0" ]
null
null
null
wazimap_ng/points/services/locations.py
Faysalali534/wazimap-ng
64cff12c042167ce633658a3c45f7c142f3fd5ce
[ "Apache-2.0" ]
null
null
null
wazimap_ng/points/services/locations.py
Faysalali534/wazimap-ng
64cff12c042167ce633658a3c45f7c142f3fd5ce
[ "Apache-2.0" ]
null
null
null
import logging from wazimap_ng.points.models import Location, Category, ProfileCategory from wazimap_ng.profile.models import Profile from wazimap_ng.datasets.models import Geography from wazimap_ng.boundaries.models import GeographyBoundary logger = logging.getLogger(__name__) def get_locations(queryset, profile, c...
35.130435
80
0.782178
import logging from wazimap_ng.points.models import Location, Category, ProfileCategory from wazimap_ng.profile.models import Profile from wazimap_ng.datasets.models import Geography from wazimap_ng.boundaries.models import GeographyBoundary logger = logging.getLogger(__name__) def get_locations(queryset, profile, c...
true
true
1c3ebb6f9ba90fb1b3461a4f89c26e5e1da1a7b6
19,196
py
Python
conda/activate.py
richmoore1962/conda
ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306
[ "BSD-3-Clause" ]
null
null
null
conda/activate.py
richmoore1962/conda
ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306
[ "BSD-3-Clause" ]
null
null
null
conda/activate.py
richmoore1962/conda
ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from glob import glob import os from os.path import abspath, basename, dirname, expanduser, expandvars, isdir, join, normpath import re import sys from tempfile import NamedTemporaryFile from .base.context impor...
38.163022
98
0.603824
from __future__ import absolute_import, division, print_function, unicode_literals from glob import glob import os from os.path import abspath, basename, dirname, expanduser, expandvars, isdir, join, normpath import re import sys from tempfile import NamedTemporaryFile from .base.context import ROOT_ENV_NAME, context...
true
true
1c3ebd21eb0eee42e9366167ff296002780b5492
4,688
py
Python
python/galB_models.py
bsafdi/galacticB
cf90459799b0917340f7b6faceab6134dc3c35b0
[ "MIT" ]
null
null
null
python/galB_models.py
bsafdi/galacticB
cf90459799b0917340f7b6faceab6134dc3c35b0
[ "MIT" ]
null
null
null
python/galB_models.py
bsafdi/galacticB
cf90459799b0917340f7b6faceab6134dc3c35b0
[ "MIT" ]
null
null
null
import numpy as np import numpy.linalg as LA #B-field model from https://arxiv.org/pdf/1204.3662.pdf iopen=11.5 #degrees rmx_array = np.array([5.1,6.3,7.1,8.3,9.8,11.4,12.7,15.5]) #kpc def return_B(x,y): ''' x,y in Galactic coords in kpc Earth at (x,y) = (-8.5,0) ''' r = np.sqrt(x,y) phi = ...
23.323383
96
0.53221
import numpy as np import numpy.linalg as LA iopen=11.5 rmx_array = np.array([5.1,6.3,7.1,8.3,9.8,11.4,12.7,15.5]) def return_B(x,y): r = np.sqrt(x,y) phi = np.arctanM(y,x) r_hat = np.array([np.cos(phi),np.sin(phi)]) phi_hat = np.array([-np.sin(phi),np.cos(phi)]) if r<5.0: B =...
true
true
1c3ebe5799f9f096dadc724348ff63069ef11359
1,884
py
Python
alipay/aop/api/response/AlipayFundTransPayResponse.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
213
2018-08-27T16:49:32.000Z
2021-12-29T04:34:12.000Z
alipay/aop/api/response/AlipayFundTransPayResponse.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
29
2018-09-29T06:43:00.000Z
2021-09-02T03:27:32.000Z
alipay/aop/api/response/AlipayFundTransPayResponse.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
59
2018-08-27T16:59:26.000Z
2022-03-25T10:08:15.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayFundTransPayResponse(AlipayResponse): def __init__(self): super(AlipayFundTransPayResponse, self).__init__() self._order_id = None self._out_biz_no = No...
28.545455
99
0.664544
import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayFundTransPayResponse(AlipayResponse): def __init__(self): super(AlipayFundTransPayResponse, self).__init__() self._order_id = None self._out_biz_no = None self._pay_fund_order_id = None ...
true
true
1c3ebf1f7628958d5b11ec3a7ac39fd0b4c0e80d
13,347
py
Python
pytorch_lightning/accelerators/tpu_accelerator.py
aribornstein/pytorch-lightning
ca68cac57ad8eefc9b477ee126eb42a483f27a39
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/accelerators/tpu_accelerator.py
aribornstein/pytorch-lightning
ca68cac57ad8eefc9b477ee126eb42a483f27a39
[ "Apache-2.0" ]
null
null
null
pytorch_lightning/accelerators/tpu_accelerator.py
aribornstein/pytorch-lightning
ca68cac57ad8eefc9b477ee126eb42a483f27a39
[ "Apache-2.0" ]
null
null
null
# Copyright The PyTorch Lightning team. # # 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 i...
36.467213
110
0.66352
import io import logging import os import re from typing import Any, Callable, Optional, Union import torch import torch.multiprocessing as mp from torch.optim import Optimizer from pytorch_lightning.accelerators.accelerator import Accelerator, ReduceOp from pytorch_lightning.cluster_environments import ClusterEnviro...
true
true
1c3ebf5598e69feb2c336c6da8f14570efb46fc9
2,548
py
Python
open_spiel/python/bots/is_mcts_test.py
texasmichelle/open_spiel
d9a9b8f9f1f44143867217fc3f6ff2db71b174b0
[ "Apache-2.0" ]
3,167
2019-08-27T06:50:30.000Z
2022-03-31T22:33:48.000Z
open_spiel/python/bots/is_mcts_test.py
texasmichelle/open_spiel
d9a9b8f9f1f44143867217fc3f6ff2db71b174b0
[ "Apache-2.0" ]
650
2019-08-27T16:24:09.000Z
2022-03-30T19:41:09.000Z
open_spiel/python/bots/is_mcts_test.py
texasmichelle/open_spiel
d9a9b8f9f1f44143867217fc3f6ff2db71b174b0
[ "Apache-2.0" ]
774
2019-08-27T10:36:04.000Z
2022-03-29T15:44:42.000Z
# Copyright 2019 DeepMind Technologies 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 appl...
35.887324
80
0.720173
from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import absltest import numpy as np from open_spiel.python.algorithms import evaluate_bots import pyspiel SEED = 12983641 class ISMCTSBotTest(absltest.TestCase): def ismcts_play_game(se...
true
true
1c3ebf8534de15eccfa8e05d6772024a0cb19ba3
1,621
py
Python
src/izi/apps/catalogue/reviews/forms.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
src/izi/apps/catalogue/reviews/forms.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
src/izi/apps/catalogue/reviews/forms.py
izi-core/izi-core
21176be2d41f0cf54ca954f294209c585f643dba
[ "BSD-3-Clause" ]
null
null
null
from django import forms from django.utils.translation import gettext_lazy as _ from izi.core.loading import get_model Vote = get_model('reviews', 'vote') ProductReview = get_model('reviews', 'productreview') class ProductReviewForm(forms.ModelForm): name = forms.CharField(label=_('Name'), required=True) em...
26.57377
61
0.632326
from django import forms from django.utils.translation import gettext_lazy as _ from izi.core.loading import get_model Vote = get_model('reviews', 'vote') ProductReview = get_model('reviews', 'productreview') class ProductReviewForm(forms.ModelForm): name = forms.CharField(label=_('Name'), required=True) em...
true
true
1c3ec00dd8b2fd9f7864c69b14adc250d65def9a
1,730
py
Python
setup.py
chiangtw/CircMiMi
f9700ab3afb79e5b730b95666482ba64f3e6ef75
[ "MIT" ]
2
2021-09-13T13:12:46.000Z
2022-01-03T05:04:32.000Z
setup.py
chiangtw/CircMiMi
f9700ab3afb79e5b730b95666482ba64f3e6ef75
[ "MIT" ]
null
null
null
setup.py
chiangtw/CircMiMi
f9700ab3afb79e5b730b95666482ba64f3e6ef75
[ "MIT" ]
1
2020-05-16T13:24:13.000Z
2020-05-16T13:24:13.000Z
import codecs import os import re from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): with codecs.open(os.path.join(here, *parts), 'r') as fp: return fp.read() def find_version(*file_paths): version_file = read(*file_paths) version_ma...
30.350877
82
0.625434
import codecs import os import re from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): with codecs.open(os.path.join(here, *parts), 'r') as fp: return fp.read() def find_version(*file_paths): version_file = read(*file_paths) version_ma...
true
true
1c3ec0239a3b51d83462da9640c1889bef35013b
3,540
py
Python
decloud/models/monthly_synthesis_6_s2s1_images_david.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
8
2022-02-25T13:15:07.000Z
2022-03-20T18:29:49.000Z
decloud/models/monthly_synthesis_6_s2s1_images_david.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
1
2022-02-25T13:21:33.000Z
2022-02-25T13:21:33.000Z
decloud/models/monthly_synthesis_6_s2s1_images_david.py
CNES/decloud
6b06ae98bfe68821b4ebd0e7ba06723809cb9b42
[ "Apache-2.0" ]
1
2022-03-31T23:43:12.000Z
2022-03-31T23:43:12.000Z
# -*- coding: utf-8 -*- """ Copyright (c) 2020-2022 INRAE 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 rights to use, copy, modify, merge, ...
51.304348
110
0.666384
from tensorflow.keras import layers from decloud.models.model import Model from decloud.preprocessing import constants class monthly_synthesis_6_s2s1_images_david(Model): def __init__(self, dataset_shapes, dataset_input_keys=["s2_t0", "s2_t1", "s2_t2", "s2_t3", "s2_t4", "s2_t5", ...
true
true
1c3ec0608c6faed4e34cec115e9524d65fc136d9
667
py
Python
utils/batch_helper.py
liushengzhong1023/multihead-siamese-nets
ccb544d5a8adefa41743ef7948aeb5f20a74507e
[ "MIT" ]
175
2018-01-26T19:22:05.000Z
2022-02-24T01:20:21.000Z
utils/batch_helper.py
liushengzhong1023/multihead-siamese-nets
ccb544d5a8adefa41743ef7948aeb5f20a74507e
[ "MIT" ]
19
2018-02-26T09:45:59.000Z
2022-02-09T23:57:22.000Z
utils/batch_helper.py
warisqr007/ConvSANN
0cede14601ce1a62bd58abf92a04ad3d7cc3be99
[ "MIT" ]
41
2018-02-27T11:20:28.000Z
2021-04-13T04:57:57.000Z
class BatchHelper: def __init__(self, x1, x2, labels, batch_size): self.x1 = x1 # self.x1 = self.x1.reshape(-1, 1) self.x2 = x2 # self.x2 = self.x2.reshape(-1, 1) self.labels = labels self.labels = self.labels.reshape(-1, 1) self.batch_size = batch_size ...
39.235294
95
0.623688
class BatchHelper: def __init__(self, x1, x2, labels, batch_size): self.x1 = x1 self.x2 = x2 self.labels = labels self.labels = self.labels.reshape(-1, 1) self.batch_size = batch_size def next(self, batch_id): x1_batch = self.x1[batch_id * self...
true
true
1c3ec089f6634e8a94af71b4270bf1a322b29773
76,413
py
Python
openpype/tools/project_manager/project_manager/model.py
jonclothcat/OpenPype
d1208cbebc0a7f378de0062ccd653295c6399195
[ "MIT" ]
null
null
null
openpype/tools/project_manager/project_manager/model.py
jonclothcat/OpenPype
d1208cbebc0a7f378de0062ccd653295c6399195
[ "MIT" ]
null
null
null
openpype/tools/project_manager/project_manager/model.py
jonclothcat/OpenPype
d1208cbebc0a7f378de0062ccd653295c6399195
[ "MIT" ]
null
null
null
import collections import copy import json from uuid import uuid4 from pymongo import UpdateOne, DeleteOne from Qt import QtCore, QtGui from .constants import ( IDENTIFIER_ROLE, ITEM_TYPE_ROLE, DUPLICATED_ROLE, HIERARCHY_CHANGE_ABLE_ROLE, REMOVED_ROLE, EDITOR_OPENED_ROLE, PROJECT_NAME_ROL...
31.497527
79
0.561776
import collections import copy import json from uuid import uuid4 from pymongo import UpdateOne, DeleteOne from Qt import QtCore, QtGui from .constants import ( IDENTIFIER_ROLE, ITEM_TYPE_ROLE, DUPLICATED_ROLE, HIERARCHY_CHANGE_ABLE_ROLE, REMOVED_ROLE, EDITOR_OPENED_ROLE, PROJECT_NAME_ROL...
true
true
1c3ec10c0be0c50347ae5364aa263e5e25c717b6
4,954
py
Python
pdbtools/pdb_chain.py
andrewsb8/pdb-tools
2fecdebd7520505b68ab515c54fa7c128e7a8090
[ "Apache-2.0" ]
192
2015-07-25T02:31:09.000Z
2022-03-29T11:09:45.000Z
pdbtools/pdb_chain.py
andrewsb8/pdb-tools
2fecdebd7520505b68ab515c54fa7c128e7a8090
[ "Apache-2.0" ]
112
2016-08-16T20:00:16.000Z
2022-03-25T00:44:16.000Z
pdbtools/pdb_chain.py
andrewsb8/pdb-tools
2fecdebd7520505b68ab515c54fa7c128e7a8090
[ "Apache-2.0" ]
55
2015-07-24T17:33:30.000Z
2022-03-17T17:36:33.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 João Pedro Rodrigues # # 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 # # Unl...
27.988701
79
0.594267
import os import sys __author__ = "Joao Rodrigues" __email__ = "j.p.g.l.m.rodrigues@gmail.com" def check_input(args): option = ' ' fh = sys.stdin if not len(args): if sys.stdin.isatty(): sys.stderr.write(__doc__) sys.exit(1) elif len(args) == 1: ...
true
true
1c3ec22b6437fb74df647b14f9882233d4fc1589
18,074
py
Python
napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py
ckishimo/napalm-yang
8f2bd907bd3afcde3c2f8e985192de74748baf6c
[ "Apache-2.0" ]
64
2016-10-20T15:47:18.000Z
2021-11-11T11:57:32.000Z
napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py
ckishimo/napalm-yang
8f2bd907bd3afcde3c2f8e985192de74748baf6c
[ "Apache-2.0" ]
126
2016-10-05T10:36:14.000Z
2019-05-15T08:43:23.000Z
napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py
ckishimo/napalm-yang
8f2bd907bd3afcde3c2f8e985192de74748baf6c
[ "Apache-2.0" ]
63
2016-11-07T15:23:08.000Z
2021-09-22T14:41:16.000Z
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
38.619658
377
0.602302
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
true
true
1c3ec271455fb4a4203f0942fbcf2dc4f068a07e
5,204
py
Python
owlbot.py
LaudateCorpus1/python-gke-hub
09e7c033fea2e07a6c865ac633ec14b3d07edf7a
[ "Apache-2.0" ]
null
null
null
owlbot.py
LaudateCorpus1/python-gke-hub
09e7c033fea2e07a6c865ac633ec14b3d07edf7a
[ "Apache-2.0" ]
null
null
null
owlbot.py
LaudateCorpus1/python-gke-hub
09e7c033fea2e07a6c865ac633ec14b3d07edf7a
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
34.013072
127
0.64854
import os import synthtool as s import synthtool.gcp as gcp from synthtool.languages import python common = gcp.CommonTemplates() default_version = "v1" for library in s.get_staging_dirs(default_version): submodules = [ "configmanagement", "multiclusteringress", ] for submodule in submodu...
true
true
1c3ec2f91b2d99d51d3ba428e99bf769634ff906
1,435
py
Python
pipeline/migrations/0012_templatecurrentversion.py
sdgdsffdsfff/bk-sops-tencent
e8aff91f822e79031e12b0f66943830f44ced506
[ "Apache-2.0" ]
1
2020-09-24T07:39:16.000Z
2020-09-24T07:39:16.000Z
pipeline/migrations/0012_templatecurrentversion.py
sdgdsffdsfff/bk-sops-tencent
e8aff91f822e79031e12b0f66943830f44ced506
[ "Apache-2.0" ]
5
2021-02-08T20:46:54.000Z
2021-06-10T22:54:45.000Z
pipeline/migrations/0012_templatecurrentversion.py
sdgdsffdsfff/bk-sops-tencent
e8aff91f822e79031e12b0f66943830f44ced506
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
39.861111
125
0.712892
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pipeline', '0011_auto_20180906_1045'), ] operations = [ migrations.CreateModel( name='TemplateCurrentVersion', fields=[ ...
true
true
1c3ec314a0794bcb54b14f7270db1ec2ee447f38
4,129
py
Python
sdk/python/pulumi_aws/storagegateway/upload_buffer.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/storagegateway/upload_buffer.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/storagegateway/upload_buffer.py
michael-golden/pulumi-aws
165e876e166ecab1870e857822247585d78aef64
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 Union from .. import utilities, tables class UploadBuffer(pulu...
42.56701
166
0.661177
import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class UploadBuffer(pulumi.CustomResource): disk_id: pulumi.Output[str] gateway_arn: pulumi.Output[str] def __init__(__self__, resource_name, opts=None, disk_id=None, gateway_arn=None, __props__=N...
true
true
1c3ec347f88de693871c19dc660539788c4b5eca
540
py
Python
PythonSolutions/763_partition_labels.py
ChuckChen2020/Leetcode
08f98365f0fac6e4a151b557b632000a34734585
[ "MIT" ]
null
null
null
PythonSolutions/763_partition_labels.py
ChuckChen2020/Leetcode
08f98365f0fac6e4a151b557b632000a34734585
[ "MIT" ]
null
null
null
PythonSolutions/763_partition_labels.py
ChuckChen2020/Leetcode
08f98365f0fac6e4a151b557b632000a34734585
[ "MIT" ]
null
null
null
#16:39 - 17:03 def partitionLabels(S: str): dic = dict() for i, c in enumerate(S): dic[c] = i end_pos = 0 ret = [] i = 0 while i <= len(S) - 1: start = i end_pos = dic[S[i]] while i != end_pos: end_pos = max...
23.478261
54
0.444444
def partitionLabels(S: str): dic = dict() for i, c in enumerate(S): dic[c] = i end_pos = 0 ret = [] i = 0 while i <= len(S) - 1: start = i end_pos = dic[S[i]] while i != end_pos: end_pos = max(end_pos, dic[S...
true
true
1c3ec3d0cac39cf9941d9ca1c590fc595be6ee34
493
py
Python
sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py
sebtelko/pulumi-azure-native
711ec021b5c73da05611c56c8a35adb0ce3244e4
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py
sebtelko/pulumi-azure-native
711ec021b5c73da05611c56c8a35adb0ce3244e4
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py
sebtelko/pulumi-azure-native
711ec021b5c73da05611c56c8a35adb0ce3244e4
[ "Apache-2.0" ]
null
null
null
# 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! *** from ... import _utilities import typing # Export this package's modules as members: from ._enums import * from .configuration import * from .firewall_...
29
80
0.744422
from ... import _utilities import typing # Export this package's modules as members: from ._enums import * from .configuration import * from .firewall_rule import * from .get_configuration import * from .get_firewall_rule import * from .get_server import * from .server import * from ._inputs import * from . import out...
true
true
1c3ec44eeefd7593b2bd53357219e6fbeeb19a01
887
py
Python
azcam_scripts/__init__.py
mplesser/azcam-scripts
116106f98352ccfc6c97b748e361fe9dadd16888
[ "MIT" ]
null
null
null
azcam_scripts/__init__.py
mplesser/azcam-scripts
116106f98352ccfc6c97b748e361fe9dadd16888
[ "MIT" ]
null
null
null
azcam_scripts/__init__.py
mplesser/azcam-scripts
116106f98352ccfc6c97b748e361fe9dadd16888
[ "MIT" ]
null
null
null
import importlib import os import azcam def load(scripts="all") -> None: """ Load all scripts from folder into azcam.db.cli_tools """ rootpackage = "azcam_scripts" folder = importlib.util.find_spec(rootpackage).submodule_search_locations[0] # bring all .py modules with same function name in...
26.088235
80
0.620068
import importlib import os import azcam def load(scripts="all") -> None: rootpackage = "azcam_scripts" folder = importlib.util.find_spec(rootpackage).submodule_search_locations[0] _, _, filenames = next(os.walk(folder)) pyfiles = [] for files in filenames: if files.endswith(".py"): ...
true
true
1c3ec5820cfff6b1650df4f4de61fd0b17c04a7e
9,946
py
Python
api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py
theosanderson/opentrons
df9f41d3dc56bd03ff0ef4e804d1224221272ddf
[ "Apache-2.0" ]
null
null
null
api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py
theosanderson/opentrons
df9f41d3dc56bd03ff0ef4e804d1224221272ddf
[ "Apache-2.0" ]
null
null
null
api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py
theosanderson/opentrons
df9f41d3dc56bd03ff0ef4e804d1224221272ddf
[ "Apache-2.0" ]
null
null
null
import logging from typing import Any, Dict import jsonschema # type: ignore from opentrons.data_storage import database as db_cmds from opentrons.protocol_api.labware import save_definition from opentrons.config import CONFIG from opentrons.legacy_api.containers.placeable import Container, Well from .util import l...
41.789916
133
0.688619
import logging from typing import Any, Dict import jsonschema from opentrons.data_storage import database as db_cmds from opentrons.protocol_api.labware import save_definition from opentrons.config import CONFIG from opentrons.legacy_api.containers.placeable import Container, Well from .util import log_call log = ...
true
true
1c3ec6385ed9ff148175b1e4f2ec924d2e0a25ce
55,048
py
Python
kafka/consumer/group.py
fchartier/kafka-python
8e1741edcf368e4eba6af6a7218f788d4aafcee8
[ "Apache-2.0" ]
null
null
null
kafka/consumer/group.py
fchartier/kafka-python
8e1741edcf368e4eba6af6a7218f788d4aafcee8
[ "Apache-2.0" ]
null
null
null
kafka/consumer/group.py
fchartier/kafka-python
8e1741edcf368e4eba6af6a7218f788d4aafcee8
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import, division import copy import logging import socket import time from kafka.errors import KafkaConfigurationError, UnsupportedVersionError from kafka.vendor import six from kafka.client_async import KafkaClient, selectors from kafka.consumer.fetcher import Fetcher from kafka.con...
47.537133
123
0.652067
from __future__ import absolute_import, division import copy import logging import socket import time from kafka.errors import KafkaConfigurationError, UnsupportedVersionError from kafka.vendor import six from kafka.client_async import KafkaClient, selectors from kafka.consumer.fetcher import Fetcher from kafka.con...
true
true
1c3ec6d3f7be58abd038f8964534a0cb398cb936
2,732
py
Python
blog/migrations/0011_auto_20200728_0547.py
tbrlpld/wagtail-gatsby-blog-backend
f68f1d9e2577d5271960f142bf37dcbcdac6767a
[ "MIT" ]
null
null
null
blog/migrations/0011_auto_20200728_0547.py
tbrlpld/wagtail-gatsby-blog-backend
f68f1d9e2577d5271960f142bf37dcbcdac6767a
[ "MIT" ]
null
null
null
blog/migrations/0011_auto_20200728_0547.py
tbrlpld/wagtail-gatsby-blog-backend
f68f1d9e2577d5271960f142bf37dcbcdac6767a
[ "MIT" ]
null
null
null
# Generated by Django 2.2.13 on 2020-07-28 05:47 from django.db import migrations import wagtail.core.blocks import wagtail.core.blocks.static_block import wagtail.core.fields import wagtail.documents.blocks import wagtail.embeds.blocks import wagtail.images.blocks class Migration(migrations.Migration): depende...
109.28
2,214
0.725842
from django.db import migrations import wagtail.core.blocks import wagtail.core.blocks.static_block import wagtail.core.fields import wagtail.documents.blocks import wagtail.embeds.blocks import wagtail.images.blocks class Migration(migrations.Migration): dependencies = [ ('blog', '0010_auto_20200728_05...
true
true
1c3ec6ff7238f3a67bc7e7cbadd77b8f9696718c
1,716
py
Python
src/third_party/red_tamarin_stable/tamarin-cental/halfmoon/templates/sexp.py
michaelpdu/flash_feature_extraction
29226a4c0e81240fd5c53fd9c80b0f6b0f5a8f95
[ "Apache-2.0" ]
1
2018-11-25T01:05:03.000Z
2018-11-25T01:05:03.000Z
avmplus/halfmoon/templates/sexp.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
avmplus/halfmoon/templates/sexp.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2019-04-12T04:18:27.000Z
2019-04-12T04:18:27.000Z
#!/usr/bin/env python # -*- Mode: Python; indent-tabs-mode: nil -*- # vi: set ts=4 sw=4 expandtab: # borrowed from http://gist.github.com/240957 # no license information found # Support for comments ; added by Adobe. from string import whitespace atom_end = set('()"\'') | set(whitespace) def parse(sexp): stack,...
33.647059
78
0.434732
from string import whitespace atom_end = set('()"\'') | set(whitespace) def parse(sexp): stack, i, length = [[]], 0, len(sexp) while i < length: c = sexp[i] #print c, stack if c == ';': while i + 1 < length and sexp[i + 1] != '\n': i += 1 else: ...
true
true
1c3ec72e9ec972f9c7d148b66f212bf3e366a340
2,457
py
Python
ctgan/data.py
JonathanDZiegler/CTGAN
7b1c110455bf776cf89a661e5ff8425d6519daf5
[ "MIT" ]
null
null
null
ctgan/data.py
JonathanDZiegler/CTGAN
7b1c110455bf776cf89a661e5ff8425d6519daf5
[ "MIT" ]
null
null
null
ctgan/data.py
JonathanDZiegler/CTGAN
7b1c110455bf776cf89a661e5ff8425d6519daf5
[ "MIT" ]
1
2021-11-18T14:23:24.000Z
2021-11-18T14:23:24.000Z
"""Data loading.""" import json import numpy as np import pandas as pd def read_csv(csv_filename, meta_filename=None, header=True, discrete=None): """Read a csv file.""" data = pd.read_csv(csv_filename, header='infer' if header else None) if meta_filename: with open(meta_filename) as meta_file:...
25.863158
78
0.553521
import json import numpy as np import pandas as pd def read_csv(csv_filename, meta_filename=None, header=True, discrete=None): data = pd.read_csv(csv_filename, header='infer' if header else None) if meta_filename: with open(meta_filename) as meta_file: metadata = json.load(meta_file) ...
true
true
1c3ec7572013460e6d2b8a5b43c1333c84548a2f
5,023
py
Python
tests/test_dependency_loop.py
TinkerBoard-Android/external-google-fruit
57123c8a2477a4d99cb68c53d195e9fb428dd535
[ "Apache-2.0" ]
1,666
2015-01-04T08:52:43.000Z
2022-03-28T11:06:19.000Z
tests/test_dependency_loop.py
TinkerBoard-Android/external-google-fruit
57123c8a2477a4d99cb68c53d195e9fb428dd535
[ "Apache-2.0" ]
135
2015-02-19T11:35:07.000Z
2022-03-29T05:00:42.000Z
tests/test_dependency_loop.py
TinkerBoard-Android/external-google-fruit
57123c8a2477a4d99cb68c53d195e9fb428dd535
[ "Apache-2.0" ]
253
2015-01-14T08:15:10.000Z
2022-03-24T07:49:53.000Z
#!/usr/bin/env python3 # Copyright 2016 Google Inc. 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 requir...
33.939189
125
0.565399
from absl.testing import parameterized from fruit_test_common import * COMMON_DEFINITIONS = ''' #include "test_common.h" struct X; struct Annotation1 {}; using XAnnot1 = fruit::Annotated<Annotation1, X>; struct Annotation2 {}; using XAnnot2 = fruit::Annotated<Annotation2, X>; struct An...
true
true
1c3ec7b6b14e02b69b8c1732d3ec1b97b07bc9d9
3,069
py
Python
docs/conf.py
mollymwieringa/sit_assimilation_osses
56eb13227cf3cf481991bd162889c49880020635
[ "MIT" ]
null
null
null
docs/conf.py
mollymwieringa/sit_assimilation_osses
56eb13227cf3cf481991bd162889c49880020635
[ "MIT" ]
null
null
null
docs/conf.py
mollymwieringa/sit_assimilation_osses
56eb13227cf3cf481991bd162889c49880020635
[ "MIT" ]
null
null
null
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
35.275862
79
0.681981
import os import pathlib import sys print("python exec:", sys.executable) print("sys.path:", sys.path) root = pathlib.Path(__file__).parent.parent.absolute() os.environ["PYTHONPATH"] = str(root) sys.path.insert(0, str(root)) import sit_assimilation_osses project = "sit_assimilation_osses" copyright = "2021, Mo...
true
true
1c3ec87ee1e156d9bd81c49a7f5849c9a0477607
466
py
Python
data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.py
obi-two/GameServer
7d37024e2291a97d49522610cd8f1dbe5666afc2
[ "MIT" ]
20
2015-02-23T15:11:56.000Z
2022-03-18T20:56:48.000Z
data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
null
null
null
data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
20
2015-04-04T16:35:59.000Z
2022-03-24T14:54:37.000Z
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/ithorian/shared_ith_jacket_s10.iff" result.attribute_temp...
27.411765
81
0.738197
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/ithorian/shared_ith_jacket_s10.iff" result.attribute_template_id = 11 result.stfName("wearables_name","ith_jacket_s10") return result
true
true
1c3ec8d51199ed160a9b1ec4dfce1a483ae737af
816
py
Python
profiles_project/urls.py
kienyiep/profile-rest-api
705c3bf9c6c45f7b860cd358520a81694c2a26cb
[ "MIT" ]
null
null
null
profiles_project/urls.py
kienyiep/profile-rest-api
705c3bf9c6c45f7b860cd358520a81694c2a26cb
[ "MIT" ]
null
null
null
profiles_project/urls.py
kienyiep/profile-rest-api
705c3bf9c6c45f7b860cd358520a81694c2a26cb
[ "MIT" ]
null
null
null
"""profiles_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cl...
32.64
77
0.707108
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('profiles_api.urls')) ]
true
true
1c3ec94e2ccb841eb99eae10987aea3e9f60f21d
11,253
py
Python
mars/tensor/linalg/norm.py
ueshin/mars
0b542974243be4e0ff239eaf49ab0fb2935f3361
[ "Apache-2.0" ]
null
null
null
mars/tensor/linalg/norm.py
ueshin/mars
0b542974243be4e0ff239eaf49ab0fb2935f3361
[ "Apache-2.0" ]
null
null
null
mars/tensor/linalg/norm.py
ueshin/mars
0b542974243be4e0ff239eaf49ab0fb2935f3361
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding 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-...
35.610759
105
0.555052
import itertools from collections.abc import Iterable import numpy as np from ... import opcodes as OperandDef from ...serialize import ValueType, KeyField, AnyField, TupleField, BoolField from ..utils import recursive_tile from ..array_utils import device, as_same_device from ..operands import TensorHasInput, Tenso...
true
true
1c3ecac895f332fe1a4efb3869906afedc532dea
953
py
Python
examples/active_learning/plot_perf.py
sudodoki/trunklucator
7d5a96d650a50e62b3ad479f72de8d60790e93a8
[ "Apache-2.0" ]
null
null
null
examples/active_learning/plot_perf.py
sudodoki/trunklucator
7d5a96d650a50e62b3ad479f72de8d60790e93a8
[ "Apache-2.0" ]
null
null
null
examples/active_learning/plot_perf.py
sudodoki/trunklucator
7d5a96d650a50e62b3ad479f72de8d60790e93a8
[ "Apache-2.0" ]
null
null
null
import matplotlib as mpl import matplotlib.pyplot as plt from io import BytesIO import base64 mpl.use('Agg') def plot_performance(performance_history): fig, ax = plt.subplots(figsize=(8.5, 6), dpi=130) ax.plot(performance_history) ax.scatter(range(len(performance_history)), performance_history, s=13) ...
30.741935
122
0.716684
import matplotlib as mpl import matplotlib.pyplot as plt from io import BytesIO import base64 mpl.use('Agg') def plot_performance(performance_history): fig, ax = plt.subplots(figsize=(8.5, 6), dpi=130) ax.plot(performance_history) ax.scatter(range(len(performance_history)), performance_history, s=13) ...
true
true
1c3ecaf3fc8f8dbaf8239f589fe967fdd4055863
1,757
py
Python
kirppuauth/migrations/0002_auto_20160127_2212.py
tracon/kirppu
65c926daa6138b14268693eeac6e6e517a3cd96b
[ "MIT" ]
null
null
null
kirppuauth/migrations/0002_auto_20160127_2212.py
tracon/kirppu
65c926daa6138b14268693eeac6e6e517a3cd96b
[ "MIT" ]
6
2017-02-03T07:42:57.000Z
2019-12-23T14:25:15.000Z
kirppuauth/migrations/0002_auto_20160127_2212.py
tracon/kirppu
65c926daa6138b14268693eeac6e6e517a3cd96b
[ "MIT" ]
6
2015-01-26T22:27:26.000Z
2019-01-20T21:57:51.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.core.validators import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('kirppuauth', '0001_initial'), ] operations = [ migrations.Al...
40.860465
420
0.623221
from __future__ import unicode_literals from django.db import migrations, models import django.core.validators import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('kirppuauth', '0001_initial'), ] operations = [ migrations.AlterModelManagers( ...
true
true
1c3ecb6add03b7112c2dee8c497792a4df9841d8
512
py
Python
gaphor/UML/interactions/__init__.py
bertob/gaphor
a1d6f8dd8c878f299980bba6c055436148573274
[ "Apache-2.0" ]
867
2018-01-09T00:19:09.000Z
2022-03-31T02:49:23.000Z
gaphor/UML/interactions/__init__.py
burakozturk16/gaphor
86267a5200ac4439626d35d306dbb376c3800107
[ "Apache-2.0" ]
790
2018-01-13T23:47:07.000Z
2022-03-31T16:04:27.000Z
gaphor/UML/interactions/__init__.py
burakozturk16/gaphor
86267a5200ac4439626d35d306dbb376c3800107
[ "Apache-2.0" ]
117
2018-01-09T02:24:49.000Z
2022-03-23T08:07:42.000Z
from gaphor.UML.interactions import ( copypaste, interactionsconnect, interactionsgrouping, interactionspropertypages, ) from gaphor.UML.interactions.executionspecification import ExecutionSpecificationItem from gaphor.UML.interactions.interaction import InteractionItem from gaphor.UML.interactions.life...
28.444444
85
0.802734
from gaphor.UML.interactions import ( copypaste, interactionsconnect, interactionsgrouping, interactionspropertypages, ) from gaphor.UML.interactions.executionspecification import ExecutionSpecificationItem from gaphor.UML.interactions.interaction import InteractionItem from gaphor.UML.interactions.life...
true
true
1c3ecced193917d21de696859842864904d72d87
3,649
py
Python
benchmarks/kvbench/novelsm/novelsm.py
huangvincent170/cyclone
737af617ab1472dfb16e6c20a079e88dccf85850
[ "Apache-2.0" ]
2
2019-04-16T01:33:36.000Z
2021-02-23T08:34:38.000Z
benchmarks/kvbench/novelsm/novelsm.py
huangvincent170/cyclone
737af617ab1472dfb16e6c20a079e88dccf85850
[ "Apache-2.0" ]
null
null
null
benchmarks/kvbench/novelsm/novelsm.py
huangvincent170/cyclone
737af617ab1472dfb16e6c20a079e88dccf85850
[ "Apache-2.0" ]
4
2020-03-27T18:06:33.000Z
2021-03-24T09:56:17.000Z
def launch_cmds_startup(): print("Configuring for rocksdb application") def launch_cmds_server_gen(f, q, r, m, quorums, replicas, clients, ports): passwd='' if os.environ.has_key('CYCLONE_PASS'): passwd=os.environ.get('CYCLONE_PASS') cmd= ' echo ' + passwd + ' | sudo -S ' cmd=cmd + 'rm -rf...
45.049383
128
0.580433
def launch_cmds_startup(): print("Configuring for rocksdb application") def launch_cmds_server_gen(f, q, r, m, quorums, replicas, clients, ports): passwd='' if os.environ.has_key('CYCLONE_PASS'): passwd=os.environ.get('CYCLONE_PASS') cmd= ' echo ' + passwd + ' | sudo -S ' cmd=cmd + 'rm -rf...
true
true
1c3eccfe5a2a05938061228955cc2ec0f6627de9
73,105
py
Python
packages/python/plotly/plotly/graph_objs/cone/_colorbar.py
eisenlohr/plotly.py
3b0e3df45036cf48f772b13bcc10ce347964aefc
[ "MIT" ]
1
2021-12-11T07:01:40.000Z
2021-12-11T07:01:40.000Z
packages/python/plotly/plotly/graph_objs/cone/_colorbar.py
jiangrongbo/plotly.py
df19fc702b309586cc24e25373b87e8bdbb3ff60
[ "MIT" ]
null
null
null
packages/python/plotly/plotly/graph_objs/cone/_colorbar.py
jiangrongbo/plotly.py
df19fc702b309586cc24e25373b87e8bdbb3ff60
[ "MIT" ]
1
2021-11-29T22:55:05.000Z
2021-11-29T22:55:05.000Z
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ColorBar(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "cone" _path_str = "cone.colorbar" _valid_props = { "bgcolor", "bordercolor...
35.643588
90
0.557582
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ColorBar(_BaseTraceHierarchyType): _parent_path_str = "cone" _path_str = "cone.colorbar" _valid_props = { "bgcolor", "bordercolor", "borderwidth", "dtick",...
true
true
1c3ecd48137353b90db4a7570b4ac12b3113cd43
218
py
Python
catalyst/contrib/criterion/__init__.py
ferrine/catalyst
b5bc4fb5f692e1fde2d95ef4a534296dccd0f717
[ "MIT" ]
null
null
null
catalyst/contrib/criterion/__init__.py
ferrine/catalyst
b5bc4fb5f692e1fde2d95ef4a534296dccd0f717
[ "MIT" ]
null
null
null
catalyst/contrib/criterion/__init__.py
ferrine/catalyst
b5bc4fb5f692e1fde2d95ef4a534296dccd0f717
[ "MIT" ]
null
null
null
# flake8: noqa from torch.nn import * from .bcece import * from .ce import * from .center_loss import * from .contrastive import * from .dice import * from .focal_loss import * from .huber import * from .unet import *
19.818182
26
0.729358
from torch.nn import * from .bcece import * from .ce import * from .center_loss import * from .contrastive import * from .dice import * from .focal_loss import * from .huber import * from .unet import *
true
true
1c3ecd98fcb15ba4a6f5bccae63e6e80e435759b
9,412
py
Python
vulnerabilities/importers/rust.py
anshsrtv/vulnerablecode
b79117f3ea50470547aa2a173265aa4e89403b50
[ "Apache-2.0" ]
null
null
null
vulnerabilities/importers/rust.py
anshsrtv/vulnerablecode
b79117f3ea50470547aa2a173265aa4e89403b50
[ "Apache-2.0" ]
null
null
null
vulnerabilities/importers/rust.py
anshsrtv/vulnerablecode
b79117f3ea50470547aa2a173265aa4e89403b50
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/vulnerablecode/ # The VulnerableCode software is licensed under the Apache License version 2.0. # Data generated with VulnerableCode require an acknowledgment. # # You may not use this software except in compli...
36.061303
100
0.657777
import asyncio import re from itertools import chain from typing import Optional from typing import Mapping from typing import List from typing import Set from typing import Tuple from urllib.error import HTTPError from urllib.request import urlopen import toml from univers.version_specifier import VersionSpecifier f...
true
true
1c3ecdaaf358b3e1ac6e7c89f30b3b9afcab7ca7
1,820
py
Python
regulations/tests/generator_subterp_tests.py
navigo/regulations-site
910c24e46f4e921210a40da452dff69feae692d4
[ "CC0-1.0" ]
18
2015-01-14T15:58:45.000Z
2019-08-17T06:15:59.000Z
regulations/tests/generator_subterp_tests.py
navigo/regulations-site
910c24e46f4e921210a40da452dff69feae692d4
[ "CC0-1.0" ]
260
2016-04-05T22:06:10.000Z
2021-01-07T22:08:15.000Z
regulations/tests/generator_subterp_tests.py
navigo/regulations-site
910c24e46f4e921210a40da452dff69feae692d4
[ "CC0-1.0" ]
45
2015-01-26T16:24:46.000Z
2021-02-20T10:50:59.000Z
from unittest import TestCase from mock import patch from regulations.generator import subterp class SubterpTest(TestCase): @patch('regulations.generator.subterp.fetch_toc') def test_filter_by_subterp(self, fetch_toc): nodes = [{'label': ['1005', 'h1', 'Interp']}, {'label': ['1005',...
44.390244
78
0.482967
from unittest import TestCase from mock import patch from regulations.generator import subterp class SubterpTest(TestCase): @patch('regulations.generator.subterp.fetch_toc') def test_filter_by_subterp(self, fetch_toc): nodes = [{'label': ['1005', 'h1', 'Interp']}, {'label': ['1005',...
true
true
1c3ece1119d3406c43d3f2ded5d89016c2782b23
7,500
py
Python
moses/contrib/arrow-pipelines/python/manager.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
3
2018-01-25T00:51:56.000Z
2022-01-07T15:09:38.000Z
moses/contrib/arrow-pipelines/python/manager.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
1
2021-11-25T18:08:22.000Z
2021-11-25T18:08:22.000Z
moses/contrib/arrow-pipelines/python/manager.py
anshsarkar/TailBench
25845756aee9a892229c25b681051591c94daafd
[ "MIT" ]
3
2018-06-08T08:36:27.000Z
2021-12-26T20:36:16.000Z
import logging import os from concurrent.futures import Future, ThreadPoolExecutor from functools import partial from pypeline.helpers.parallel_helpers import eval_pipeline, \ cons_function_component, \ cons_wire, \ cons_split_wire, \ cons_unsplit_wire, \ cons_dictionary_wire # # Some logging ple...
38.860104
124
0.637333
import logging import os from concurrent.futures import Future, ThreadPoolExecutor from functools import partial from pypeline.helpers.parallel_helpers import eval_pipeline, \ cons_function_component, \ cons_wire, \ cons_split_wire, \ cons_unsplit_wire, \ cons_dictionary_wire FORMAT = '%(asctime)...
true
true
1c3ece2c42a04a5c61f6788d458259f9c5c0c5cc
5,260
py
Python
tests/python/unittest/test_codegen_device.py
zhanghaohit/incubator-tvm
ee0af843f3c5a3429e888079afb5f30789bd9bee
[ "Zlib", "Unlicense", "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0" ]
2
2019-01-07T06:00:27.000Z
2019-02-28T15:07:16.000Z
tests/python/unittest/test_codegen_device.py
zhanghaohit/incubator-tvm
ee0af843f3c5a3429e888079afb5f30789bd9bee
[ "Zlib", "Unlicense", "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0" ]
4
2021-03-30T11:59:59.000Z
2022-03-12T00:40:23.000Z
tests/python/unittest/test_codegen_device.py
zhanghaohit/incubator-tvm
ee0af843f3c5a3429e888079afb5f30789bd9bee
[ "Zlib", "Unlicense", "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0" ]
3
2021-07-20T07:40:15.000Z
2021-08-03T08:39:17.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 u...
36.783217
82
0.619962
import tvm from tvm.contrib import util import numpy as np def test_large_uint_imm(): value = (1 << 63) + 123 other = tvm.const(3, "uint64") n = 12 num_thread = 2 A = tvm.compute((n,), lambda *i: tvm.const(value, "uint64") + other, name='A') s = tvm.create_schedule(A.op) xo, xi = s[A].spl...
true
true
1c3ecf27e6ed0d2f16c459636707fbe1dbed8674
4,553
py
Python
notebooks/kf-1.0-workshop.py
zaxcie/flower_workshop
c879b9e1687e786a1510a640e1b1680375dff172
[ "FTL" ]
null
null
null
notebooks/kf-1.0-workshop.py
zaxcie/flower_workshop
c879b9e1687e786a1510a640e1b1680375dff172
[ "FTL" ]
null
null
null
notebooks/kf-1.0-workshop.py
zaxcie/flower_workshop
c879b9e1687e786a1510a640e1b1680375dff172
[ "FTL" ]
null
null
null
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.3' # jupytext_version: 0.8.1 # kernelspec: # display_name: Python (dl) # language: python # name: dl # langua...
23.963158
120
0.682627
# + # %load_ext autoreload # %autoreload 2\ import os import random from skimage.io import imread, imshow import matplotlib.pyplot as plt import matplotlib.image as mpimg # %matplotlib inline # - def show_images_horizontal(path, n=5): files = random.sample(os.listdir(path), 5) images = list() ...
true
true
1c3ed05ee52038ba5c0bd1bdc2585a78b8cf946e
492
py
Python
src/coop_assembly/__version__.py
createchaos/coop_assembly
71108b0639323cf3d996d63b0f702d45f4d60d67
[ "MIT" ]
3
2019-09-21T09:20:15.000Z
2020-02-12T21:53:07.000Z
src/coop_assembly/__version__.py
createchaos/coop_assembly
71108b0639323cf3d996d63b0f702d45f4d60d67
[ "MIT" ]
null
null
null
src/coop_assembly/__version__.py
createchaos/coop_assembly
71108b0639323cf3d996d63b0f702d45f4d60d67
[ "MIT" ]
1
2019-12-18T12:51:08.000Z
2019-12-18T12:51:08.000Z
__title__ = 'coop_assembly' __description__ = 'Geometry generation of robotically assembled spatial structures' __url__ = 'https://github.com/createchaos/coop_assembly' __version__ = '0.0.1' __author__ = 'Stefana Parascho' __author_email__ = 'parascho@princeton.edu' __license__ = 'MIT license' __copyright__ = 'Copyrigh...
41
83
0.762195
__title__ = 'coop_assembly' __description__ = 'Geometry generation of robotically assembled spatial structures' __url__ = 'https://github.com/createchaos/coop_assembly' __version__ = '0.0.1' __author__ = 'Stefana Parascho' __author_email__ = 'parascho@princeton.edu' __license__ = 'MIT license' __copyright__ = 'Copyrigh...
true
true
1c3ed1847f6aa6d5eb851011932ff553610206dd
12,107
py
Python
tracer/android_tracer.py
XTechnologyTR/appmon
974418b80e2a3d49278b3acb2c86651894260dda
[ "Apache-2.0" ]
1,392
2016-04-29T13:31:53.000Z
2022-03-31T07:40:50.000Z
tracer/android_tracer.py
XTechnologyTR/appmon
974418b80e2a3d49278b3acb2c86651894260dda
[ "Apache-2.0" ]
105
2016-04-29T12:13:18.000Z
2022-03-24T17:27:58.000Z
tracer/android_tracer.py
XTechnologyTR/appmon
974418b80e2a3d49278b3acb2c86651894260dda
[ "Apache-2.0" ]
298
2016-04-29T12:03:15.000Z
2022-03-25T13:45:01.000Z
#!/usr/bin/python ### # Copyright (c) 2016 Nishant Das Patnaik. # # 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 b...
37.252308
416
0.563971
import os, sys, frida, re, argparse, codecs, json from termcolor import colored print(""" ___ .______ .______ .___ ___. ______ .__ __. / \ | _ \ | _ \ | \/ | / __ \ | \ | | / ^ \ | |_) | | |_) | | \ / | | | | | | \| | / /_\ \ ...
true
true
1c3ed2bf9c387aab43e5622dc881396402695b4f
8,064
py
Python
pollbot/telegram/job.py
annihilatorrrr/ultimate-poll-bot
7ecd1c0ac09a01bd4224c654bf951196dfb0207c
[ "MIT" ]
112
2019-06-11T17:52:57.000Z
2022-03-18T00:05:21.000Z
pollbot/telegram/job.py
annihilatorrrr/ultimate-poll-bot
7ecd1c0ac09a01bd4224c654bf951196dfb0207c
[ "MIT" ]
91
2019-05-28T11:33:40.000Z
2022-02-27T12:12:07.000Z
pollbot/telegram/job.py
annihilatorrrr/ultimate-poll-bot
7ecd1c0ac09a01bd4224c654bf951196dfb0207c
[ "MIT" ]
69
2019-07-10T16:58:06.000Z
2022-03-30T22:09:44.000Z
"""Handle messages.""" from datetime import date, datetime, timedelta from sqlalchemy import or_ from sqlalchemy.orm import joinedload from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError from sqlalchemy.orm.scoping import scoped_session from telegram.error import BadRequest, RetryAfter, Unauthorized from...
36.324324
96
0.625868
from datetime import date, datetime, timedelta from sqlalchemy import or_ from sqlalchemy.orm import joinedload from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError from sqlalchemy.orm.scoping import scoped_session from telegram.error import BadRequest, RetryAfter, Unauthorized from telegram.ext.callbackc...
true
true
1c3ed32e53fa0dfa1d1ba7876f61cbf18edade25
5,090
py
Python
utils.py
smitkiri/nypd-misconduct-dashboard
2b16d24f33bab7f3b09e8a068a2bb7233d978928
[ "MIT" ]
2
2020-09-12T00:13:03.000Z
2020-12-05T07:01:04.000Z
utils.py
smitkiri/nypd-misconduct-dashboard
2b16d24f33bab7f3b09e8a068a2bb7233d978928
[ "MIT" ]
null
null
null
utils.py
smitkiri/nypd-misconduct-dashboard
2b16d24f33bab7f3b09e8a068a2bb7233d978928
[ "MIT" ]
1
2020-08-24T16:05:25.000Z
2020-08-24T16:05:25.000Z
import pandas as pd import pickle import plotly.graph_objs as go def get_command(x, command_key): try: command = command_key[x] except: command = float('nan') return command def get_command_key(): #Get command abbreviations command_df = pd.read_excel('NYPD-Misconduct-Complaint-Dat...
38.560606
133
0.644401
import pandas as pd import pickle import plotly.graph_objs as go def get_command(x, command_key): try: command = command_key[x] except: command = float('nan') return command def get_command_key(): command_df = pd.read_excel('NYPD-Misconduct-Complaint-Database-Updated/CCRB Filespec...
true
true
1c3ed46d063c4579b35ae4dbdad3ad13ad8a9ac0
3,072
py
Python
indico/core/signals/event/registration.py
tobiashuste/indico
c1e6ec0c8c84745988e38c9b1768142a6feb9e0e
[ "MIT" ]
null
null
null
indico/core/signals/event/registration.py
tobiashuste/indico
c1e6ec0c8c84745988e38c9b1768142a6feb9e0e
[ "MIT" ]
null
null
null
indico/core/signals/event/registration.py
tobiashuste/indico
c1e6ec0c8c84745988e38c9b1768142a6feb9e0e
[ "MIT" ]
null
null
null
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from blinker import Namespace _signals = Namespace() registrat...
39.384615
103
0.77181
from __future__ import unicode_literals from blinker import Namespace _signals = Namespace() registration_personal_data_modified = _signals.signal('registration-personal-data-modified', """ Called when the registration personal data is modified. The `sender` is the `Registration` object; the change is passed in th...
true
true
1c3ed4b0cc5ab9bf06582c115f4991fc26fb456c
260
py
Python
examples/optimizers/create_hs.py
macoldibelli/opytimizer
ca0574d520ecc17b1ac875bc6271d466c88d18ac
[ "MIT" ]
null
null
null
examples/optimizers/create_hs.py
macoldibelli/opytimizer
ca0574d520ecc17b1ac875bc6271d466c88d18ac
[ "MIT" ]
null
null
null
examples/optimizers/create_hs.py
macoldibelli/opytimizer
ca0574d520ecc17b1ac875bc6271d466c88d18ac
[ "MIT" ]
null
null
null
from opytimizer.optimizers.hs import HS # One should declare a hyperparameters object based # on the desired algorithm that will be used hyperparams = { 'HMCR': 0.7, 'PAR': 0.7, 'bw': 1 } # Creating a HS optimizer o = HS(hyperparams=hyperparams)
20
51
0.7
from opytimizer.optimizers.hs import HS hyperparams = { 'HMCR': 0.7, 'PAR': 0.7, 'bw': 1 } o = HS(hyperparams=hyperparams)
true
true
1c3ed5c4ddde80567b53059419d01c45b6cac254
634
py
Python
Amelie/pack_feature_vector_cdll.py
HuMingqi/Amelie_S
1044441d0a302b4833fe6aab0f177fdf89443623
[ "MIT" ]
null
null
null
Amelie/pack_feature_vector_cdll.py
HuMingqi/Amelie_S
1044441d0a302b4833fe6aab0f177fdf89443623
[ "MIT" ]
null
null
null
Amelie/pack_feature_vector_cdll.py
HuMingqi/Amelie_S
1044441d0a302b4833fe6aab0f177fdf89443623
[ "MIT" ]
null
null
null
import ctypes #locate .dll file. using absolute path in django. relative path just in python intertive mode #!!! feature_vector depend on opencv_world310d.dll , you can include it in system32 dll_path="G:/ResearchTraining/Amelie_Server/DLLS/feature_vector.dll" #dll_path="D:/Clothes Search System/AmelieServer/DL...
33.368421
94
0.782334
import ctypes dll_path="G:/ResearchTraining/Amelie_Server/DLLS/feature_vector.dll" dll=ctypes.CDLL(dll_path) get_feature_vector=dll.get_feature_vector get_feature_vector.argtypes=(ctypes.c_double*24,ctypes.c_char_p)
true
true
1c3ed60041bd004a3090a6f1457dc9479b8f6e65
2,196
py
Python
tests/unit/test_integration.py
shogo82148/acme-cert-updater
4693ef2e96654c2eba199dd84635d1b87264ec48
[ "MIT" ]
9
2019-03-10T11:02:11.000Z
2021-07-02T12:39:59.000Z
tests/unit/test_integration.py
shogo82148/acme-cert-updater
4693ef2e96654c2eba199dd84635d1b87264ec48
[ "MIT" ]
58
2019-08-12T05:37:34.000Z
2022-03-25T10:35:55.000Z
tests/unit/test_integration.py
shogo82148/acme-cert-updater
4693ef2e96654c2eba199dd84635d1b87264ec48
[ "MIT" ]
1
2021-09-16T00:29:26.000Z
2021-09-16T00:29:26.000Z
"""tests of acme-cert-updater""" import unittest import secrets import traceback import boto3 from typing import List from updater import app # pylint: disable=missing-docstring AUTHOR_ACCOUNT = '445285296882' class DummyConfig: def __init__(self): self._prefix = secrets.token_hex(16) @property ...
24.4
105
0.624317
import unittest import secrets import traceback import boto3 from typing import List from updater import app AUTHOR_ACCOUNT = '445285296882' class DummyConfig: def __init__(self): self._prefix = secrets.token_hex(16) @property def domains(self) -> List[str]: return ['shogo82148.com', '...
true
true
1c3ed6c03b8fe64c7476a5230fcf005cc7c91298
31,311
py
Python
language/mentionmemory/modules/mention_losses_test.py
urikz/language
503aca178c98fed4c606cf83e58ae0f84012a4d9
[ "Apache-2.0" ]
1,199
2018-10-16T01:30:18.000Z
2022-03-31T21:05:24.000Z
language/mentionmemory/modules/mention_losses_test.py
urikz/language
503aca178c98fed4c606cf83e58ae0f84012a4d9
[ "Apache-2.0" ]
116
2018-10-18T03:31:46.000Z
2022-03-24T13:40:50.000Z
language/mentionmemory/modules/mention_losses_test.py
urikz/language
503aca178c98fed4c606cf83e58ae0f84012a4d9
[ "Apache-2.0" ]
303
2018-10-22T12:35:12.000Z
2022-03-27T17:38:17.000Z
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
43.976124
83
0.67414
import functools from absl.testing import absltest from absl.testing import parameterized import jax import jax.numpy as jnp import language.mentionmemory.modules.mention_losses as mention_losses from language.mentionmemory.utils import mention_utils from language.mentionmemory.utils import test_utils import numpy as...
true
true
1c3ed72bc6c644886efad8191a3375ad2c5fc776
17,558
py
Python
src/pip/_internal/resolution/legacy/resolver.py
lhchavez/pip
bd5ac261c0bf4c9a37322b2cfe1b2564479f56ad
[ "MIT" ]
2
2021-11-11T10:44:41.000Z
2022-03-29T17:18:30.000Z
src/pip/_internal/resolution/legacy/resolver.py
illia-v/pip
76cd70ac42cbbe6a51d83bd100f500ac4c21f26b
[ "MIT" ]
3
2021-12-16T17:05:16.000Z
2022-03-14T21:51:36.000Z
src/pip/_internal/resolution/legacy/resolver.py
illia-v/pip
76cd70ac42cbbe6a51d83bd100f500ac4c21f26b
[ "MIT" ]
null
null
null
"""Dependency Resolution The dependency resolution in pip is performed as follows: for top-level requirements: a. only one spec allowed per project, regardless of conflicts or not. otherwise a "double requirement" exception is raised b. they override sub-dependency requirements. for sub-dependencies ...
38.674009
87
0.651498
import logging import sys from collections import defaultdict from itertools import chain from typing import DefaultDict, Iterable, List, Optional, Set, Tuple from pip._vendor.packaging import specifiers from pip._vendor.pkg_resources import Distribution from pip._internal.cache import WheelCache from pip._internal...
true
true
1c3edbaee88f4ef3b685314892ef219d9fb001ea
4,083
py
Python
dolo/tests/test_splines.py
christophe-gouel/dolo
d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d
[ "BSD-2-Clause" ]
null
null
null
dolo/tests/test_splines.py
christophe-gouel/dolo
d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d
[ "BSD-2-Clause" ]
null
null
null
dolo/tests/test_splines.py
christophe-gouel/dolo
d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d
[ "BSD-2-Clause" ]
null
null
null
# # if __name__ == '__main__': # # from dolo.numeric.interpolation.splines import MultivariateSplines # from dolo.numeric.interpolation.multilinear import MultilinearInterpolator # # # import numpy as np # # N_grid = 20 # N_fine_grid = 50 # d = 3 # # smin = np.array( [0.0]*d ) # smax = n...
30.470149
113
0.532697
true
true
1c3edc1a9535df18cdc85a59a9b87070c0014d91
3,535
py
Python
scripts/mixexpDemo.py
karalleyna/pyprobml
72195e46fdffc4418910e76d02e3d6469f4ce272
[ "MIT" ]
2
2021-06-22T05:43:25.000Z
2021-06-22T08:40:16.000Z
scripts/mixexpDemo.py
Rebeca98/pyprobml
2a4b9a267f64720cbba35dfa41af3e995ea006ca
[ "MIT" ]
null
null
null
scripts/mixexpDemo.py
Rebeca98/pyprobml
2a4b9a267f64720cbba35dfa41af3e995ea006ca
[ "MIT" ]
1
2021-06-21T01:18:07.000Z
2021-06-21T01:18:07.000Z
import pyprobml_utils as pml import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.special import logsumexp from sklearn.linear_model import LinearRegression from scipy.stats import multivariate_normal n = 200 np.random.seed(1) y = np.random.rand(n, 1) eta = np.random.randn(n,1)*0.05 x = y ...
25.80292
88
0.596322
import pyprobml_utils as pml import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.special import logsumexp from sklearn.linear_model import LinearRegression from scipy.stats import multivariate_normal n = 200 np.random.seed(1) y = np.random.rand(n, 1) eta = np.random.randn(n,1)*0.05 x = y ...
true
true
1c3edd0047b74206ceda57dd243e48dfb9db1917
2,637
py
Python
fairseq/optim/lr_scheduler/fixed_schedule.py
kayoyin/DialogueMT
aa426ebcdbdfe0366ed06081a842945f2108e85f
[ "MIT" ]
112
2021-01-04T13:19:24.000Z
2022-03-23T21:49:00.000Z
fairseq/optim/lr_scheduler/fixed_schedule.py
kayoyin/DialogueMT
aa426ebcdbdfe0366ed06081a842945f2108e85f
[ "MIT" ]
21
2021-03-18T09:39:00.000Z
2022-03-22T09:41:48.000Z
fairseq/optim/lr_scheduler/fixed_schedule.py
kayoyin/DialogueMT
aa426ebcdbdfe0366ed06081a842945f2108e85f
[ "MIT" ]
19
2021-01-28T08:07:03.000Z
2022-03-31T08:31:36.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. from . import FairseqLRScheduler, register_lr_scheduler @register_lr_scheduler('fixed') class FixedSchedule(FairseqLRScheduler): """Deca...
38.217391
93
0.618127
from . import FairseqLRScheduler, register_lr_scheduler @register_lr_scheduler('fixed') class FixedSchedule(FairseqLRScheduler): def __init__(self, args, optimizer): super().__init__(args, optimizer) args.warmup_updates = getattr(args, 'warmup_updates', 0) or 0 self.lr = args.l...
true
true
1c3edd7dc690e18f8c678b526484905b94fc01d9
1,144
py
Python
py/leetcode/RedundantConnection.py
danyfang/SourceCode
8168f6058648f2a330a7354daf3a73a4d8a4e730
[ "MIT" ]
null
null
null
py/leetcode/RedundantConnection.py
danyfang/SourceCode
8168f6058648f2a330a7354daf3a73a4d8a4e730
[ "MIT" ]
null
null
null
py/leetcode/RedundantConnection.py
danyfang/SourceCode
8168f6058648f2a330a7354daf3a73a4d8a4e730
[ "MIT" ]
null
null
null
''' Leetcode problem No 684 Redundant Connection Solution written by Xuqiang Fang on 12 June, 2018 ''' class Solution(object): ''' union find ''' def findRedundantConnection(self, edge): n = len(edge) p = [0 for x in range(n+1)] s = [1 for x in range(n+1)] for e in edge...
24.869565
49
0.434441
class Solution(object): def findRedundantConnection(self, edge): n = len(edge) p = [0 for x in range(n+1)] s = [1 for x in range(n+1)] for e in edge: u = e[0]; v = e[1] if p[u] == 0: p[u] = u if p[v] == 0: p[v] = v ...
true
true
1c3edeaa50330434fd48e38aa8cbe9af373be385
35
py
Python
OOP/OOP-Practice/underscore/main.py
siddhantdixit/OOP-ClassWork
ce414a3836d03aa7dee0eb1d7a69e849fb6707c0
[ "MIT" ]
null
null
null
OOP/OOP-Practice/underscore/main.py
siddhantdixit/OOP-ClassWork
ce414a3836d03aa7dee0eb1d7a69e849fb6707c0
[ "MIT" ]
null
null
null
OOP/OOP-Practice/underscore/main.py
siddhantdixit/OOP-ClassWork
ce414a3836d03aa7dee0eb1d7a69e849fb6707c0
[ "MIT" ]
null
null
null
from prob import * Pref()._myfunc()
17.5
18
0.714286
from prob import * Pref()._myfunc()
true
true
1c3edfd0a7ee08c38a2c867ee1df04078c23142d
448
py
Python
data/scripts/templates/object/mobile/shared_nightspider_aggressor.py
obi-two/GameServer
7d37024e2291a97d49522610cd8f1dbe5666afc2
[ "MIT" ]
20
2015-02-23T15:11:56.000Z
2022-03-18T20:56:48.000Z
data/scripts/templates/object/mobile/shared_nightspider_aggressor.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
null
null
null
data/scripts/templates/object/mobile/shared_nightspider_aggressor.py
apathyboy/swganh
665128efe9154611dec4cb5efc61d246dd095984
[ "MIT" ]
20
2015-04-04T16:35:59.000Z
2022-03-24T14:54:37.000Z
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_nightspider_aggressor.iff" result.attribute_template_id = 9 r...
26.352941
67
0.732143
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_nightspider_aggressor.iff" result.attribute_template_id = 9 result.stfName("monster_name","hermit_spider") return result
true
true
1c3ee1adcd0fc78c7b46e0181a9583404d382497
570
py
Python
analytics/migrations/0006_auto_20201019_1554.py
12remember/qrl-analytics
17d728225026354a9b2af3bd81cf11cef06279df
[ "MIT" ]
null
null
null
analytics/migrations/0006_auto_20201019_1554.py
12remember/qrl-analytics
17d728225026354a9b2af3bd81cf11cef06279df
[ "MIT" ]
1
2022-03-03T21:55:24.000Z
2022-03-03T21:55:24.000Z
analytics/migrations/0006_auto_20201019_1554.py
12remember/quantascan-backend
17d728225026354a9b2af3bd81cf11cef06279df
[ "MIT" ]
null
null
null
# Generated by Django 3.1.1 on 2020-10-19 15:54 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('analytics', '0005_auto_20201019_1549'), ] operations = [ migrations.RenameField( model_name='qrlaggregatedtransactiondata', ...
24.782609
59
0.622807
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('analytics', '0005_auto_20201019_1549'), ] operations = [ migrations.RenameField( model_name='qrlaggregatedtransactiondata', old_name='type_of_transaction', new_...
true
true
1c3ee1dfba8b2f8904b4d92a37b045666bf735f3
1,175
py
Python
src/servo.py
macbury/pussificator
1a8a3e0d029ec6f22161dfc41349f82b5df55a9f
[ "MIT" ]
3
2019-01-09T09:54:25.000Z
2019-06-30T07:10:01.000Z
src/servo.py
macbury/pussificator
1a8a3e0d029ec6f22161dfc41349f82b5df55a9f
[ "MIT" ]
null
null
null
src/servo.py
macbury/pussificator
1a8a3e0d029ec6f22161dfc41349f82b5df55a9f
[ "MIT" ]
null
null
null
import time import json from boot import CONFIG, LOGGER from mqtt import MqttClient import RPi.GPIO as GPIO mqtt = MqttClient(CONFIG['mqtt']) SERVO_PIN = 12 GPIO.setmode(GPIO.BOARD) GPIO.setup(SERVO_PIN, GPIO.OUT) pwm = GPIO.PWM(SERVO_PIN, 50) pwm.start(0) def turnOff(): GPIO.output(SERVO_PIN, False) pwm.Chang...
19.262295
64
0.700426
import time import json from boot import CONFIG, LOGGER from mqtt import MqttClient import RPi.GPIO as GPIO mqtt = MqttClient(CONFIG['mqtt']) SERVO_PIN = 12 GPIO.setmode(GPIO.BOARD) GPIO.setup(SERVO_PIN, GPIO.OUT) pwm = GPIO.PWM(SERVO_PIN, 50) pwm.start(0) def turnOff(): GPIO.output(SERVO_PIN, False) pwm.Chang...
true
true
1c3ee281afe8d6eb06955116a1e1fc292afe6064
5,186
py
Python
backend/main.py
waltercassiano/micropython-spa-react
110fcd88c170251adad2b7e2e14dbdad94657370
[ "MIT" ]
6
2020-05-29T01:39:21.000Z
2022-03-08T02:29:29.000Z
backend/main.py
waltercassiano/micropython-spa-react
110fcd88c170251adad2b7e2e14dbdad94657370
[ "MIT" ]
2
2022-02-13T11:59:34.000Z
2022-02-27T03:49:49.000Z
backend/main.py
waltercassiano/micropython-spa-react
110fcd88c170251adad2b7e2e14dbdad94657370
[ "MIT" ]
null
null
null
import network import ure as re import ubinascii import uhashlib from mimes import mime_content_type import utils if __name__ == "__main__": picoweb = utils.import_or_install("picoweb", "picoweb") logging = utils.import_or_install("micropython-ulogging", "ulogging") from app_esp import config_service, user_ser...
32.822785
122
0.66371
import network import ure as re import ubinascii import uhashlib from mimes import mime_content_type import utils if __name__ == "__main__": picoweb = utils.import_or_install("picoweb", "picoweb") logging = utils.import_or_install("micropython-ulogging", "ulogging") from app_esp import config_service, user_ser...
true
true
1c3ee31a3897e2679ba3ab6df576be1484820e70
121
py
Python
products/admin.py
anilchoudhary/ecommerce
f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe
[ "MIT" ]
null
null
null
products/admin.py
anilchoudhary/ecommerce
f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe
[ "MIT" ]
null
null
null
products/admin.py
anilchoudhary/ecommerce
f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Product # Register your models here. admin.site.register(Product)
17.285714
32
0.801653
from django.contrib import admin from .models import Product admin.site.register(Product)
true
true
1c3ee34bf04c7cd14bd2cad070e9fb1c573743f3
4,115
py
Python
drive.py
eagleanurag/End-to-End-Learning-for-Self-Driving-Cars
0a32d90a6714515b6f0f0366b298b9c6d06119ab
[ "MIT" ]
null
null
null
drive.py
eagleanurag/End-to-End-Learning-for-Self-Driving-Cars
0a32d90a6714515b6f0f0366b298b9c6d06119ab
[ "MIT" ]
null
null
null
drive.py
eagleanurag/End-to-End-Learning-for-Self-Driving-Cars
0a32d90a6714515b6f0f0366b298b9c6d06119ab
[ "MIT" ]
1
2018-11-05T05:11:02.000Z
2018-11-05T05:11:02.000Z
import argparse import base64 from io import BytesIO import cv2 import eventlet.wsgi import numpy as np import socketio from PIL import Image from flask import Flask from keras.models import model_from_json # Fix error with Keras and TensorFlow # tf.python.control_flow_ops = tf sio = socketio.Server() app = Flask(_...
31.899225
143
0.652734
import argparse import base64 from io import BytesIO import cv2 import eventlet.wsgi import numpy as np import socketio from PIL import Image from flask import Flask from keras.models import model_from_json sio = socketio.Server() app = Flask(__name__) model = None prev_image_array = None @sio.on('telemetry') def ...
true
true
1c3ee39784619349a5434c775720649d03c9987e
76,938
py
Python
graph_objs/layout/polar/_angularaxis.py
wwwidonja/changed_plotly
1bda35a438539a97c84a3ab3952e95e8848467bd
[ "MIT" ]
null
null
null
graph_objs/layout/polar/_angularaxis.py
wwwidonja/changed_plotly
1bda35a438539a97c84a3ab3952e95e8848467bd
[ "MIT" ]
null
null
null
graph_objs/layout/polar/_angularaxis.py
wwwidonja/changed_plotly
1bda35a438539a97c84a3ab3952e95e8848467bd
[ "MIT" ]
null
null
null
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class AngularAxis(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.polar" _path_str = "layout.polar.angularaxis" _valid_props = { "autot...
36.918426
105
0.571044
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class AngularAxis(_BaseLayoutHierarchyType): _parent_path_str = "layout.polar" _path_str = "layout.polar.angularaxis" _valid_props = { "autotypenumbers", "categoryarray", ...
true
true
1c3ee3ab8eb676d6083f1638cf4a2fa7730a9183
2,353
py
Python
inception/inception/imagenet_distributed_train.py
robrkerr/tensorflow-models
3656a07e89be134c2bc333c60a6c709e475024a6
[ "Apache-2.0" ]
308
2018-09-06T18:46:57.000Z
2022-03-28T08:22:45.000Z
inception/inception/imagenet_distributed_train.py
robrkerr/tensorflow-models
3656a07e89be134c2bc333c60a6c709e475024a6
[ "Apache-2.0" ]
64
2018-06-20T10:14:17.000Z
2021-09-08T05:58:25.000Z
inception/inception/imagenet_distributed_train.py
robrkerr/tensorflow-models
3656a07e89be134c2bc333c60a6c709e475024a6
[ "Apache-2.0" ]
69
2018-09-18T12:06:56.000Z
2022-03-14T11:49:16.000Z
# Copyright 2016 Google Inc. 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 law or a...
35.651515
80
0.700382
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from inception import inception_distributed_train from inception.imagenet_data import ImagenetData FLAGS = tf.app.flags.FLAGS def main(unused_args): assert FLAGS.job_name in ['ps',...
true
true
1c3ee3f422b44ece53bc045044eb6ac24646c86c
1,354
py
Python
app.py
tamercuba/Hole-Checker
4aac2c12023bd967a9a967d09145ce96c0f7fc27
[ "MIT" ]
null
null
null
app.py
tamercuba/Hole-Checker
4aac2c12023bd967a9a967d09145ce96c0f7fc27
[ "MIT" ]
null
null
null
app.py
tamercuba/Hole-Checker
4aac2c12023bd967a9a967d09145ce96c0f7fc27
[ "MIT" ]
null
null
null
#!/usr/bin/env python from unicodedata import normalize import re template = { 'A': 1, 'B': 2, 'C': 0, 'D': 1, 'E': 0, 'F': 0, 'G': 0, 'H': 0, 'I':0, 'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 1, 'P': 1, 'Q': 1, 'R': 1, 'S': 0, 'T': 0, 'U': 0, 'V': 0, 'X': 0, 'Z': 0, 'Y': 0, 'W': 0, 'a': 1, 'b': 1,...
32.238095
76
0.488922
from unicodedata import normalize import re template = { 'A': 1, 'B': 2, 'C': 0, 'D': 1, 'E': 0, 'F': 0, 'G': 0, 'H': 0, 'I':0, 'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 1, 'P': 1, 'Q': 1, 'R': 1, 'S': 0, 'T': 0, 'U': 0, 'V': 0, 'X': 0, 'Z': 0, 'Y': 0, 'W': 0, 'a': 1, 'b': 1, 'c': 0, 'd': 1, 'e': ...
true
true
1c3ee498ef484f6bcd6ee5707607fd898847237d
10,678
py
Python
jorldy/core/agent/rnd_ppo.py
ramanuzan/JORLDY
be371ad0607e5dba5d5082101c38c6a9f2c96767
[ "Apache-2.0" ]
null
null
null
jorldy/core/agent/rnd_ppo.py
ramanuzan/JORLDY
be371ad0607e5dba5d5082101c38c6a9f2c96767
[ "Apache-2.0" ]
null
null
null
jorldy/core/agent/rnd_ppo.py
ramanuzan/JORLDY
be371ad0607e5dba5d5082101c38c6a9f2c96767
[ "Apache-2.0" ]
null
null
null
import torch torch.backends.cudnn.benchmark = True import torch.nn.functional as F from torch.distributions import Normal, Categorical import os import numpy as np from .ppo import PPO from core.network import Network class RND_PPO(PPO): """Random Network Distillation (RND) with PPO agent. Args: st...
35.712375
105
0.52847
import torch torch.backends.cudnn.benchmark = True import torch.nn.functional as F from torch.distributions import Normal, Categorical import os import numpy as np from .ppo import PPO from core.network import Network class RND_PPO(PPO): def __init__( self, state_size, action_size, ...
true
true
1c3ee539cc4950ecc94f13b442b74342ad083484
4,764
py
Python
mfr/extensions/tabular/render.py
yacchin1205/RDM-modular-file-renderer
5bd18175a681d21e7be7fe0238132335a1cd8ded
[ "Apache-2.0" ]
36
2015-08-31T20:24:22.000Z
2021-12-17T17:02:44.000Z
mfr/extensions/tabular/render.py
yacchin1205/RDM-modular-file-renderer
5bd18175a681d21e7be7fe0238132335a1cd8ded
[ "Apache-2.0" ]
190
2015-01-02T06:22:01.000Z
2022-01-19T11:27:03.000Z
mfr/extensions/tabular/render.py
yacchin1205/RDM-modular-file-renderer
5bd18175a681d21e7be7fe0238132335a1cd8ded
[ "Apache-2.0" ]
47
2015-01-27T15:45:22.000Z
2021-01-27T22:43:03.000Z
import json import gc import logging import os from humanfriendly import format_size from mako.lookup import TemplateLookup from mfr.core import extension from mfr.extensions.tabular import settings, exceptions logger = logging.getLogger(__name__) class TabularRenderer(extension.BaseRenderer): TEMPLATE = Temp...
34.521739
99
0.594039
import json import gc import logging import os from humanfriendly import format_size from mako.lookup import TemplateLookup from mfr.core import extension from mfr.extensions.tabular import settings, exceptions logger = logging.getLogger(__name__) class TabularRenderer(extension.BaseRenderer): TEMPLATE = Temp...
true
true
1c3ee72bbc28c79942db067dc586c55460ee4caf
2,589
py
Python
tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
1,127
2018-10-15T14:36:58.000Z
2020-04-20T09:29:44.000Z
tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
439
2018-10-20T04:40:35.000Z
2020-04-19T05:56:25.000Z
tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py
ryanloney/openvino-1
4e0a740eb3ee31062ba0df88fcf438564f67edb7
[ "Apache-2.0" ]
414
2018-10-17T05:53:46.000Z
2020-04-16T17:29:53.000Z
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import unittest import numpy as np import onnx from generator import generator, generate import openvino.tools.mo.front.onnx.activation_ext as extractors from openvino.tools.mo.ops.activation_ops import Elu from openvino.tools.mo.graph...
29.420455
143
0.591348
import unittest import numpy as np import onnx from generator import generator, generate import openvino.tools.mo.front.onnx.activation_ext as extractors from openvino.tools.mo.ops.activation_ops import Elu from openvino.tools.mo.graph.graph import Node from openvino.tools.mo.ops.op import Op from unit_tests.utils.e...
true
true
1c3ee7b266d51215d446e12b11014bfad3376df9
1,438
py
Python
docs/conf.py
qlixed/pymemwiper
216bc05f9b67e37d0c98e3f3a70f08e3362f07d9
[ "MIT" ]
2
2017-12-08T22:52:20.000Z
2018-10-28T20:40:42.000Z
docs/conf.py
qlixed/pymemwiper
216bc05f9b67e37d0c98e3f3a70f08e3362f07d9
[ "MIT" ]
20
2017-06-04T22:13:06.000Z
2020-01-05T22:32:24.000Z
docs/conf.py
qlixed/python-memwiper
216bc05f9b67e37d0c98e3f3a70f08e3362f07d9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext...
26.145455
74
0.698192
from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext.viewcode', ] if os.gete...
true
true
1c3ee841d66b0cc7cfd54b1431b94a4ac454cbf5
1,596
py
Python
aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
1
2019-12-23T12:36:43.000Z
2019-12-23T12:36:43.000Z
aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
null
null
null
aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
1
2021-02-23T11:27:54.000Z
2021-02-23T11:27:54.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 u...
33.25
71
0.754386
from aliyunsdkcore.request import RpcRequest class DeleteTagSetRequest(RpcRequest): def __init__(self): RpcRequest.__init__(self, 'imm', '2017-09-06', 'DeleteTagSet','imm') def get_LazyMode(self): return self.get_query_params().get('LazyMode') def set_LazyMode(self,LazyMode): self.add_query_param('La...
true
true
1c3eea5aece6d683e89d4098eb1688877e50e47b
1,110
py
Python
tscore-test.py
newsgac/fasttext-runs
50cc6bf4d8441f7208efb6b71eb45e7641d1af09
[ "Apache-2.0" ]
null
null
null
tscore-test.py
newsgac/fasttext-runs
50cc6bf4d8441f7208efb6b71eb45e7641d1af09
[ "Apache-2.0" ]
null
null
null
tscore-test.py
newsgac/fasttext-runs
50cc6bf4d8441f7208efb6b71eb45e7641d1af09
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python3 -W all """ tscore-test.py: tests for tscore.py usage: tscore-test.py 20171124 erikt(at)xs4all.nl """ import io import re import sys import unittest from contextlib import redirect_stdout from tscore import computeTscore from tscore import readData from tscore import tscore from tscore im...
25.813953
71
0.67027
import io import re import sys import unittest from contextlib import redirect_stdout from tscore import computeTscore from tscore import readData from tscore import tscore from tscore import writeData DATA1 = { "totalFreq":3, "nbrOfWords":2, "wordFreqs":{"a":1, "b":2 } } DATA2 = { "totalFreq":3, "nbrOfWords":2, "wor...
true
true
1c3eea8396057943c4ed0c68011b18c7115b86f1
8,057
py
Python
Main_.py
snehasharma0707/License-Plate-Recognition
433251795c5fdef06ab07497d5d13537a89c1a41
[ "CNRI-Python" ]
null
null
null
Main_.py
snehasharma0707/License-Plate-Recognition
433251795c5fdef06ab07497d5d13537a89c1a41
[ "CNRI-Python" ]
null
null
null
Main_.py
snehasharma0707/License-Plate-Recognition
433251795c5fdef06ab07497d5d13537a89c1a41
[ "CNRI-Python" ]
null
null
null
import cv2 import numpy as np import os from skimage import io import requests import random import numpy as np # linear algebra import pandas as pd # data processing from tqdm import tqdm from PIL import Image import matplotlib.pyplot as plt import urllib3 import json import cv2 import matplotlib.pyplot as plt import ...
42.856383
185
0.616358
import cv2 import numpy as np import os from skimage import io import requests import random import numpy as np import pandas as pd from tqdm import tqdm from PIL import Image import matplotlib.pyplot as plt import urllib3 import json import cv2 import matplotlib.pyplot as plt import matplotlib.patches as patches from ...
true
true
1c3eec849a00dba654771c573292ef1c74284641
796
py
Python
celeba/networks/ConvNetworkImgClfCelebA.py
thomassutter/MoPoE
477a441ecb6c735a0b8af4d643fe3ac04c58171f
[ "MIT" ]
3
2021-05-06T18:29:09.000Z
2022-01-13T03:23:25.000Z
celeba/networks/ConvNetworkImgClfCelebA.py
thomassutter/MoPoE
477a441ecb6c735a0b8af4d643fe3ac04c58171f
[ "MIT" ]
1
2022-02-02T07:49:59.000Z
2022-02-16T08:16:20.000Z
celeba/networks/ConvNetworkImgClfCelebA.py
thomassutter/MoPoE
477a441ecb6c735a0b8af4d643fe3ac04c58171f
[ "MIT" ]
2
2021-05-13T02:20:42.000Z
2022-03-30T04:05:43.000Z
import torch import torch.nn as nn from celeba.networks.FeatureExtractorImg import FeatureExtractorImg class ClfImg(nn.Module): def __init__(self, flags): super(ClfImg, self).__init__(); self.feature_extractor = FeatureExtractorImg(flags, a=2.0, b=0.3); self.dropout = nn.Dropout(p=0.5, in...
30.615385
108
0.639447
import torch import torch.nn as nn from celeba.networks.FeatureExtractorImg import FeatureExtractorImg class ClfImg(nn.Module): def __init__(self, flags): super(ClfImg, self).__init__(); self.feature_extractor = FeatureExtractorImg(flags, a=2.0, b=0.3); self.dropout = nn.Dropout(p=0.5, in...
true
true
1c3eef416f2f4b2e50f755eea0af040fb2ac3e74
305
py
Python
2015/12/death-states-20151124/graphic_config.py
nprapps/graphics-archive
97b0ef326b46a959df930f5522d325e537f7a655
[ "FSFAP" ]
14
2015-05-08T13:41:51.000Z
2021-02-24T12:34:55.000Z
2015/12/death-states-20151124/graphic_config.py
nprapps/graphics-archive
97b0ef326b46a959df930f5522d325e537f7a655
[ "FSFAP" ]
null
null
null
2015/12/death-states-20151124/graphic_config.py
nprapps/graphics-archive
97b0ef326b46a959df930f5522d325e537f7a655
[ "FSFAP" ]
7
2015-04-04T04:45:54.000Z
2021-02-18T11:12:48.000Z
#!/usr/bin/env python import base_filters COPY_GOOGLE_DOC_KEY = '1s9AJPa3Tyim5sl5xA1U0Rn3imyJ8Ycy0pjM9zNYje2A' USE_ASSETS = False # Use these variables to override the default cache timeouts for this graphic # DEFAULT_MAX_AGE = 20 # ASSETS_MAX_AGE = 300 JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
21.785714
77
0.819672
import base_filters COPY_GOOGLE_DOC_KEY = '1s9AJPa3Tyim5sl5xA1U0Rn3imyJ8Ycy0pjM9zNYje2A' USE_ASSETS = False JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
true
true
1c3eef61636dfc6d89773110c3f2c0042d21da47
5,720
py
Python
prompty/vcs.py
tnhung2011/prompty
e2a08b235675d469153b233b86e535551b54fba6
[ "MIT" ]
5
2016-01-07T15:15:48.000Z
2018-04-04T11:32:06.000Z
prompty/vcs.py
tnhung2011/prompty
e2a08b235675d469153b233b86e535551b54fba6
[ "MIT" ]
21
2015-05-20T11:30:43.000Z
2020-08-01T14:09:19.000Z
prompty/vcs.py
tnhung2011/prompty
e2a08b235675d469153b233b86e535551b54fba6
[ "MIT" ]
1
2021-12-18T13:25:25.000Z
2021-12-18T13:25:25.000Z
#!/usr/bin/env python # vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc ABC = abc.ABCMeta(str('ABC'), (object,), {'__slots__': ()}) # noqa, compatible...
29.637306
101
0.589685
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import abc ABC = abc.ABCMeta(str('ABC'), (object,), {'__slots__': ()}) from builtins import str import subprocess from prompty import functionBase class VCS(object):...
true
true
1c3eef73558629c63b8748c6c61ec75dac6338d5
338
py
Python
votepredictapp/urls.py
davidhammaker/votepredictbackend
766467f85faf8a1d11da8c798b30904af9268504
[ "MIT" ]
null
null
null
votepredictapp/urls.py
davidhammaker/votepredictbackend
766467f85faf8a1d11da8c798b30904af9268504
[ "MIT" ]
null
null
null
votepredictapp/urls.py
davidhammaker/votepredictbackend
766467f85faf8a1d11da8c798b30904af9268504
[ "MIT" ]
null
null
null
from django.urls import include, path from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register(r"questions", views.QuestionViewSet) urlpatterns = [ path("", include(router.urls)), path("reply/", views.ReplyView.as_view()), path("totals/", views.TotalsV...
24.142857
52
0.730769
from django.urls import include, path from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register(r"questions", views.QuestionViewSet) urlpatterns = [ path("", include(router.urls)), path("reply/", views.ReplyView.as_view()), path("totals/", views.TotalsV...
true
true
1c3eef7ba4a7c4fdc2c91473e4bd1ee6d01d74ee
672
py
Python
WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/fileinput/fileinput_change_subnet_noisy.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/fileinput/fileinput_change_subnet_noisy.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/fileinput/fileinput_change_subnet_noisy.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
# Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Simplistic sed implementation """ # end_pymotw_header import fileinput import glob import sys from_base = sys.argv[1] to_base = sys.argv[2] files = sys.argv[3:] for line in fileinput.input(files, inplace=True): if fileinput.isfirstline(): sys...
28
88
0.709821
import fileinput import glob import sys from_base = sys.argv[1] to_base = sys.argv[2] files = sys.argv[3:] for line in fileinput.input(files, inplace=True): if fileinput.isfirstline(): sys.stderr.write("Started processing {}\n".format(fileinput.filename())) sys.stderr.write("Directory contains: {...
true
true
1c3eefbea593be09972f9ea725f0661fe763ffae
723
py
Python
generators/simple/templates/src/platform/extensionRunner/util.py
jfallaire/generator-ps-boilerplate-project
36f544a54442c191430451715425da98ea76a63e
[ "MIT" ]
2
2019-07-24T16:00:51.000Z
2019-10-03T18:36:20.000Z
generators/simple/templates/src/platform/extensionRunner/util.py
jfallaire/generator-ps-boilerplate-project
36f544a54442c191430451715425da98ea76a63e
[ "MIT" ]
19
2019-06-20T21:58:44.000Z
2020-11-05T13:48:42.000Z
generators/simple/templates/src/platform/extensionRunner/util.py
jfallaire/generator-ps-boilerplate-project
36f544a54442c191430451715425da98ea76a63e
[ "MIT" ]
1
2019-06-22T17:30:42.000Z
2019-06-22T17:30:42.000Z
import os import json import tempfile import zlib import base64 import urllib.request def zlib_compress_str(content): outdata = zlib.compress(content, zlib.Z_BEST_COMPRESSION) encodedData = base64.encodebytes(outdata) #print('zlib compressed >>> {}'.format(encodedData)) return encodedData ...
27.807692
149
0.672199
import os import json import tempfile import zlib import base64 import urllib.request def zlib_compress_str(content): outdata = zlib.compress(content, zlib.Z_BEST_COMPRESSION) encodedData = base64.encodebytes(outdata) return encodedData def get_html_content(url): hdr = {'User-Agent'...
true
true
1c3ef042bcfda68952527fd044dab09d320c8203
13,289
py
Python
configs/example/memtest.py
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
765
2015-01-14T16:17:04.000Z
2022-03-28T07:46:28.000Z
configs/example/memtest.py
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
30
2015-01-01T21:49:38.000Z
2021-04-20T19:01:54.000Z
configs/example/memtest.py
hyu-iot/gem5
aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5
[ "BSD-3-Clause" ]
807
2015-01-06T09:55:38.000Z
2022-03-30T10:23:36.000Z
# Copyright (c) 2015, 2018 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the function...
41.270186
79
0.662503
import argparse import random import sys import m5 from m5.objects import * parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("-a", "--atomic", action="store_true", help="Use atomic (non-timing) mode") parser.add_argument("-b", "--...
true
true
1c3ef05626d3001d6615345a37559166642dbf90
2,329
py
Python
src/tt_xsolla/tt_xsolla/service.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
85
2017-11-21T12:22:02.000Z
2022-03-27T23:07:17.000Z
src/tt_xsolla/tt_xsolla/service.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
545
2017-11-04T14:15:04.000Z
2022-03-27T14:19:27.000Z
src/tt_xsolla/tt_xsolla/service.py
Alacrate/the-tale
43b211f3a99e93964e95abc20a8ed649a205ffcf
[ "BSD-3-Clause" ]
45
2017-11-11T12:36:30.000Z
2022-02-25T06:10:44.000Z
import logging import asyncio from aiohttp import web from tt_web import log from tt_web import postgresql from tt_web.common import event from . import conf from . import logic PAYMENT_PROCESSING_TASK = None async def start_payment_processing(config): global PAYMENT_PROCESSING_TASK async def process_p...
22.833333
95
0.738085
import logging import asyncio from aiohttp import web from tt_web import log from tt_web import postgresql from tt_web.common import event from . import conf from . import logic PAYMENT_PROCESSING_TASK = None async def start_payment_processing(config): global PAYMENT_PROCESSING_TASK async def process_p...
true
true
1c3ef07816a957f2cca01e78a60ccc6f7ff6c908
3,936
py
Python
tests/rbac/common/addresser/task_admin_tests.py
fthornton67/sawtooth-next-directory
79479afb8d234911c56379bb1d8abf11f28ef86d
[ "Apache-2.0" ]
75
2018-04-06T09:13:34.000Z
2020-05-18T18:59:47.000Z
tests/rbac/common/addresser/task_admin_tests.py
fthornton67/sawtooth-next-directory
79479afb8d234911c56379bb1d8abf11f28ef86d
[ "Apache-2.0" ]
989
2018-04-18T21:01:56.000Z
2019-10-23T15:37:09.000Z
tests/rbac/common/addresser/task_admin_tests.py
fthornton67/sawtooth-next-directory
79479afb8d234911c56379bb1d8abf11f28ef86d
[ "Apache-2.0" ]
72
2018-04-13T18:29:12.000Z
2020-05-29T06:00:33.000Z
# Copyright 2019 Contributors to Hyperledger Sawtooth # # 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 ...
40.163265
88
0.689278
import pytest from rbac.common import addresser from rbac.common.logs import get_default_logger from tests.rbac.common.assertions import TestAssertions LOGGER = get_default_logger(__name__) @pytest.mark.addressing @pytest.mark.library class TestTaskAdminAddresser(TestAssertions): def test_address(self): ...
true
true
1c3ef0d84790c32f8626dfe621ea95c9af18d260
1,646
py
Python
logging/logging.py
badgeteam/micropython-lib
fca0235c166ebbada489d88c42fc549267832797
[ "PSF-2.0" ]
6
2017-12-31T16:19:16.000Z
2021-04-26T02:03:30.000Z
logging/logging.py
badgeteam/micropython-lib
fca0235c166ebbada489d88c42fc549267832797
[ "PSF-2.0" ]
1
2020-06-24T02:37:58.000Z
2020-06-24T02:37:58.000Z
logging/logging.py
badgeteam/micropython-lib
fca0235c166ebbada489d88c42fc549267832797
[ "PSF-2.0" ]
3
2019-07-01T18:29:54.000Z
2020-06-24T20:15:10.000Z
import sys CRITICAL = 50 ERROR = 40 WARNING = 30 INFO = 20 DEBUG = 10 NOTSET = 0 _level_dict = { CRITICAL: "CRIT", ERROR: "ERROR", WARNING: "WARN", INFO: "INFO", DEBUG: "DEBUG", } _stream = sys.stderr class Logger: def __init__(self, name): self.level = NOTSET s...
21.657895
96
0.595383
import sys CRITICAL = 50 ERROR = 40 WARNING = 30 INFO = 20 DEBUG = 10 NOTSET = 0 _level_dict = { CRITICAL: "CRIT", ERROR: "ERROR", WARNING: "WARN", INFO: "INFO", DEBUG: "DEBUG", } _stream = sys.stderr class Logger: def __init__(self, name): self.level = NOTSET s...
true
true
1c3ef0d87119236f2d3e758926f3d1b3c3e375d9
625
py
Python
lab/refactoring/decompose_conditional.py
ikejs/SPD-2.31-Testing-and-Architecture
0f1cc3dc726d748cbd3ae75b336c42697a4b9d82
[ "MIT" ]
null
null
null
lab/refactoring/decompose_conditional.py
ikejs/SPD-2.31-Testing-and-Architecture
0f1cc3dc726d748cbd3ae75b336c42697a4b9d82
[ "MIT" ]
null
null
null
lab/refactoring/decompose_conditional.py
ikejs/SPD-2.31-Testing-and-Architecture
0f1cc3dc726d748cbd3ae75b336c42697a4b9d82
[ "MIT" ]
null
null
null
# By Kami Bigdely # Decompose conditional: You have a complicated conditional(if-then-else) statement. Extract # methods from the condition, then part, and else part(s). def make_alert_sound(): print('made alert sound.') def make_accept_sound(): print('made acceptance sound') ingredients = [ 'sodium benzo...
21.551724
92
0.6432
def make_alert_sound(): print('made alert sound.') def make_accept_sound(): print('made acceptance sound') ingredients = [ 'sodium benzoate' ] toxins = [ 'sodium nitrate', 'sodium benzoate', 'sodium oxide' ] if toxins in ingredients: print('!!!') print('there is a toxin in the food!...
true
true
1c3ef25388e77a1795dd23955ad7fc87a0bb0ddd
12,693
py
Python
torch/tensor.py
UmaTaru/run
be29e4d41a4de3dee27cd6796801bfe51382d294
[ "MIT" ]
null
null
null
torch/tensor.py
UmaTaru/run
be29e4d41a4de3dee27cd6796801bfe51382d294
[ "MIT" ]
null
null
null
torch/tensor.py
UmaTaru/run
be29e4d41a4de3dee27cd6796801bfe51382d294
[ "MIT" ]
null
null
null
import torch from . import _tensor_str from ._utils import _type, _cuda, _range, _rebuild_tensor import sys class _TensorBase(object): #: bool: True if this is a CUDA tensor is_cuda = False is_sparse = False def new(self, *args, **kwargs): """Constructs a new tensor of the same data type.""" ...
32.134177
105
0.573308
import torch from . import _tensor_str from ._utils import _type, _cuda, _range, _rebuild_tensor import sys class _TensorBase(object): is_cuda = False is_sparse = False def new(self, *args, **kwargs): return self.__class__(*args, **kwargs) def type_as(self, tensor): return self.t...
true
true
1c3ef48bc5e3786c556eee182690af45b40856ac
1,854
py
Python
secao04_factory/abstract_factory.py
ravellys/design_patterns_python
6c29d1d77d4522255e10eca237f8f95b69d7210c
[ "MIT" ]
null
null
null
secao04_factory/abstract_factory.py
ravellys/design_patterns_python
6c29d1d77d4522255e10eca237f8f95b69d7210c
[ "MIT" ]
null
null
null
secao04_factory/abstract_factory.py
ravellys/design_patterns_python
6c29d1d77d4522255e10eca237f8f95b69d7210c
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod # Abstract factory class PizzaFactory(ABC): @abstractmethod def criar_pizza(self): pass @abstractmethod def criar_pizza_vegana(self): pass # Concrect Factory class PizzaBrasileiraFactory(PizzaFactory): def criar_pizza(self): return Pi...
22.888889
106
0.686084
from abc import ABC, abstractmethod class PizzaFactory(ABC): @abstractmethod def criar_pizza(self): pass @abstractmethod def criar_pizza_vegana(self): pass class PizzaBrasileiraFactory(PizzaFactory): def criar_pizza(self): return PizzaCamarao() def criar_pizza_vega...
true
true
1c3ef5954090ff2844946ed9928596b498fc65ba
3,200
py
Python
sqlalchemy_collectd/client/tests/test_plugin.py
jvanasco/sqlalchemy-collectd
8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e
[ "MIT" ]
null
null
null
sqlalchemy_collectd/client/tests/test_plugin.py
jvanasco/sqlalchemy-collectd
8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e
[ "MIT" ]
null
null
null
sqlalchemy_collectd/client/tests/test_plugin.py
jvanasco/sqlalchemy-collectd
8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e
[ "MIT" ]
null
null
null
import unittest import mock from sqlalchemy.engine import url as sqla_url from .. import plugin class PluginTest(unittest.TestCase): def test_start_no_args(self): with mock.patch.object(plugin, "start_plugin") as start_plugin: url = sqla_url.URL("mysql+pymysql://scott:tiger@localhost/") ...
36.781609
79
0.584688
import unittest import mock from sqlalchemy.engine import url as sqla_url from .. import plugin class PluginTest(unittest.TestCase): def test_start_no_args(self): with mock.patch.object(plugin, "start_plugin") as start_plugin: url = sqla_url.URL("mysql+pymysql://scott:tiger@localhost/") ...
true
true
1c3ef6016330ed5b1789e5f911abf858f0b1bf46
8,016
py
Python
homeassistant/components/tibber/sensor.py
kdschlosser/home-assistant
a94a24f6f83508642e220fadf2799789dc32a25b
[ "Apache-2.0" ]
2
2020-06-17T01:23:01.000Z
2020-06-18T22:17:14.000Z
homeassistant/components/tibber/sensor.py
kdschlosser/home-assistant
a94a24f6f83508642e220fadf2799789dc32a25b
[ "Apache-2.0" ]
1
2019-02-09T15:44:11.000Z
2019-02-09T15:44:11.000Z
homeassistant/components/tibber/sensor.py
kdschlosser/home-assistant
a94a24f6f83508642e220fadf2799789dc32a25b
[ "Apache-2.0" ]
1
2019-08-13T11:54:30.000Z
2019-08-13T11:54:30.000Z
""" Support for Tibber. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.tibber/ """ import asyncio import logging from datetime import timedelta import aiohttp from homeassistant.components.tibber import DOMAIN as TIBBER_DOMAIN from homeassistan...
33.261411
78
0.631362
import asyncio import logging from datetime import timedelta import aiohttp from homeassistant.components.tibber import DOMAIN as TIBBER_DOMAIN from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers.entity import Entity from homeassistant.util import dt as dt_util from homeassistant.util im...
true
true
1c3ef6e63a51101f65832c61279954bc32fb9cee
432
py
Python
src/0973_K_closest_points_to_origin.py
hariharanragothaman/leetcode-solutions
44e759f80d3c9df382fdf8d694d6378881e3649d
[ "Apache-2.0" ]
2
2021-04-21T07:59:42.000Z
2021-06-17T17:14:26.000Z
src/0973_K_closest_points_to_origin.py
hariharanragothaman/pyrevise-leetcode
44e759f80d3c9df382fdf8d694d6378881e3649d
[ "Apache-2.0" ]
null
null
null
src/0973_K_closest_points_to_origin.py
hariharanragothaman/pyrevise-leetcode
44e759f80d3c9df382fdf8d694d6378881e3649d
[ "Apache-2.0" ]
null
null
null
""" Given an array of points, find the number of closest points to origin """ from typing import List import heapq def KClosest_using_sort(points: List[List[int]], k: int) -> List[List[int]]: points = sorted(points, lambda P: P[0] ** 2 + P[1] ** 2) return points[:k] def KClosest_using_heap(points: List[Lis...
27
76
0.652778
from typing import List import heapq def KClosest_using_sort(points: List[List[int]], k: int) -> List[List[int]]: points = sorted(points, lambda P: P[0] ** 2 + P[1] ** 2) return points[:k] def KClosest_using_heap(points: List[List[int]], k: int) -> List[List[int]]: return heapq.nsmallest(k, points, key...
true
true
1c3ef75effc0c8895dcb921e1215e239572fd9cc
4,592
py
Python
python/oneflow/compatible/single_client/nn/optimizer/sgd.py
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
1
2022-01-19T07:50:28.000Z
2022-01-19T07:50:28.000Z
python/oneflow/compatible/single_client/nn/optimizer/sgd.py
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
null
null
null
python/oneflow/compatible/single_client/nn/optimizer/sgd.py
mosout/oneflow
afbb221d900f1a340568ae2462b2022f8fcc4b3d
[ "Apache-2.0" ]
null
null
null
""" Copyright 2020 The OneFlow Authors. 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 law or agr...
37.639344
135
0.564895
import collections from typing import Callable, Dict, Iterator, List, Union from oneflow.compatible import single_client as flow from oneflow.compatible.single_client.nn.parameter import Parameter from .optimizer import Optimizer, ParamGroup class SGD(Optimizer): def __init__( self, parameters:...
true
true
1c3ef780c4c334aeb6fe7c61688c81c9940bc419
14,109
py
Python
test/search_api/filters/test_search_api_where_filter.py
antolinos/datagateway-api
c6aa15ea01545f7a8e58e656c569523c60f7e4ef
[ "Apache-2.0" ]
null
null
null
test/search_api/filters/test_search_api_where_filter.py
antolinos/datagateway-api
c6aa15ea01545f7a8e58e656c569523c60f7e4ef
[ "Apache-2.0" ]
null
null
null
test/search_api/filters/test_search_api_where_filter.py
antolinos/datagateway-api
c6aa15ea01545f7a8e58e656c569523c60f7e4ef
[ "Apache-2.0" ]
null
null
null
import pytest from datagateway_api.src.common.date_handler import DateHandler from datagateway_api.src.common.filter_order_handler import FilterOrderHandler from datagateway_api.src.search_api.filters import SearchAPIWhereFilter from datagateway_api.src.search_api.nested_where_filters import NestedWhereFilters from da...
44.507886
88
0.495995
import pytest from datagateway_api.src.common.date_handler import DateHandler from datagateway_api.src.common.filter_order_handler import FilterOrderHandler from datagateway_api.src.search_api.filters import SearchAPIWhereFilter from datagateway_api.src.search_api.nested_where_filters import NestedWhereFilters from da...
true
true
1c3ef815b3a802937a031342ebb24aaf30ca0421
406,377
py
Python
Data/scigrid-de/pypower/scigrid_2011_01_06_19.py
thanever/SOC
9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4
[ "MIT" ]
null
null
null
Data/scigrid-de/pypower/scigrid_2011_01_06_19.py
thanever/SOC
9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4
[ "MIT" ]
null
null
null
Data/scigrid-de/pypower/scigrid_2011_01_06_19.py
thanever/SOC
9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4
[ "MIT" ]
null
null
null
from numpy import array def scigrid_2011_01_06_19(): ppc = {"version": '2'} ppc["baseMVA"] = 100.0 ppc["bus"] = array([ [586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ], [589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ], [590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,...
70.933322
137
0.463252
from numpy import array def scigrid_2011_01_06_19(): ppc = {"version": '2'} ppc["baseMVA"] = 100.0 ppc["bus"] = array([ [586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ], [589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ], [590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,...
true
true
1c3ef8d5d2ecd45e965099d0b652f213cd2a3600
1,333
py
Python
var/spack/repos/builtin/packages/gnat/package.py
HaochengLIU/spack
26e51ff1705a4d6234e2a0cf734f93f7f95df5cb
[ "ECL-2.0", "Apache-2.0", "MIT" ]
2
2018-11-27T03:39:44.000Z
2021-09-06T15:50:35.000Z
var/spack/repos/builtin/packages/gnat/package.py
HaochengLIU/spack
26e51ff1705a4d6234e2a0cf734f93f7f95df5cb
[ "ECL-2.0", "Apache-2.0", "MIT" ]
1
2019-01-11T20:11:52.000Z
2019-01-11T20:11:52.000Z
var/spack/repos/builtin/packages/gnat/package.py
HaochengLIU/spack
26e51ff1705a4d6234e2a0cf734f93f7f95df5cb
[ "ECL-2.0", "Apache-2.0", "MIT" ]
1
2020-10-14T14:20:17.000Z
2020-10-14T14:20:17.000Z
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Gnat(MakefilePackage): """The GNAT Ada compiler. Ada is a modern programming language desi...
40.393939
79
0.71943
from spack import * class Gnat(MakefilePackage): homepage = "https://libre.adacore.com/tools/gnat-gpl-edition/" # There may actually be a way to install GNAT from source. If you go to # the GNAT Download page: https://libre.adacore.com/download/ # select "Free Software or Academic Development"...
true
true
1c3ef8da034054faf6b90a5fb4f4bab244f16ddb
8,709
py
Python
nncf/torch/tensor_statistics/collectors.py
MaximProshin/nncf
2290d2f4cebcf6749e419dc76850e7bd8b7d8da1
[ "Apache-2.0" ]
null
null
null
nncf/torch/tensor_statistics/collectors.py
MaximProshin/nncf
2290d2f4cebcf6749e419dc76850e7bd8b7d8da1
[ "Apache-2.0" ]
null
null
null
nncf/torch/tensor_statistics/collectors.py
MaximProshin/nncf
2290d2f4cebcf6749e419dc76850e7bd8b7d8da1
[ "Apache-2.0" ]
null
null
null
""" Copyright (c) 2022 Intel Corporation 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 writin...
43.328358
104
0.722701
from typing import Union, List, Deque import torch from nncf.common.tensor import NNCFTensor from nncf.common.tensor import TensorElementsType from nncf.common.tensor_statistics.collectors import MinMaxStatisticCollector from nncf.common.tensor_statistics.collectors import NNCFCollectorTensorProcessor from nncf.comm...
true
true
1c3efa4ec23c095d461e41407238996c900843aa
548
py
Python
logic-programming/11-lesson/homework.py
BrendanGlancy/akron
3e067ce2e622f4c6d18aecb62402eb888b0bdb7a
[ "MIT" ]
3
2021-12-07T22:24:09.000Z
2022-02-25T01:11:40.000Z
logic-programming/11-lesson/homework.py
BrendanGlancy/akron
3e067ce2e622f4c6d18aecb62402eb888b0bdb7a
[ "MIT" ]
null
null
null
logic-programming/11-lesson/homework.py
BrendanGlancy/akron
3e067ce2e622f4c6d18aecb62402eb888b0bdb7a
[ "MIT" ]
null
null
null
""" Complete Programming Review Questions 1-10 page 464 Programming Exercises 1 on page 467. 1. B 2. C 3. D 4. A 5. B 6. C 7. A 8. B 9. A 10. B """ # Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in ascending order and display its content...
18.896552
171
0.638686
def main(): scores = [] for i in range(10): print('Enter golf score ',i) score = int(input(" ")) scores.append(score) scores.sort() print(scores) if __name__ == "__main__": main()
true
true
1c3efabc4da2175b4ec67c8a48bd257fa8e46bd9
5,107
py
Python
action_prediction_dataset.py
yukw777/GATA-public
e8c424093377874b395abaf9662f6fb2c553e0f5
[ "MIT" ]
26
2020-02-24T01:35:32.000Z
2022-02-17T03:57:06.000Z
action_prediction_dataset.py
yukw777/GATA-public
e8c424093377874b395abaf9662f6fb2c553e0f5
[ "MIT" ]
21
2020-03-11T20:07:01.000Z
2021-11-14T03:12:17.000Z
action_prediction_dataset.py
yukw777/GATA-public
e8c424093377874b395abaf9662f6fb2c553e0f5
[ "MIT" ]
12
2020-03-02T22:50:35.000Z
2022-03-08T19:10:51.000Z
import os import json from os.path import join as pjoin from tqdm import tqdm import numpy as np import gym from graph_dataset import GraphDataset class APData(gym.Env): FILENAMES_MAP = { "full": { "train": "train.full.json", "valid": "valid.full.json", "test": "tes...
37.277372
108
0.60329
import os import json from os.path import join as pjoin from tqdm import tqdm import numpy as np import gym from graph_dataset import GraphDataset class APData(gym.Env): FILENAMES_MAP = { "full": { "train": "train.full.json", "valid": "valid.full.json", "test": "tes...
true
true
1c3efb94a5faeb625776595e939cf45335985bee
161
py
Python
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_BestCycle_MLP.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_BestCycle_MLP.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
1
2019-11-30T23:39:38.000Z
2019-12-01T04:34:35.000Z
tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_BestCycle_MLP.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['LinearTrend'] , ['BestCycle'] , ['MLP'] );
40.25
83
0.751553
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Integration'] , ['LinearTrend'] , ['BestCycle'] , ['MLP'] );
true
true
1c3efbd6ca771f960b74e6c39b6eb04038e73e32
2,519
py
Python
experiments/06_preprocessing/plot_histograms.py
fsschneider/cockpit-experiments
a9eaf3dc5da5a58356ac0eef25a11235bf0891c4
[ "MIT" ]
7
2021-11-02T11:23:49.000Z
2022-02-16T13:25:47.000Z
experiments/06_preprocessing/plot_histograms.py
fsschneider/cockpit-experiments
a9eaf3dc5da5a58356ac0eef25a11235bf0891c4
[ "MIT" ]
null
null
null
experiments/06_preprocessing/plot_histograms.py
fsschneider/cockpit-experiments
a9eaf3dc5da5a58356ac0eef25a11235bf0891c4
[ "MIT" ]
2
2021-11-02T11:23:54.000Z
2022-02-02T15:56:03.000Z
"""Plot the histograms for different pre-processing strategies.""" import os import sys import matplotlib as mpl import matplotlib.pyplot as plt import run_histograms_cifar10 import run_histograms_imagenet import seaborn as sns from cockpit import CockpitPlotter from cockpit.instruments.histogram_2d_gauge import _get...
27.681319
79
0.709408
import os import sys import matplotlib as mpl import matplotlib.pyplot as plt import run_histograms_cifar10 import run_histograms_imagenet import seaborn as sns from cockpit import CockpitPlotter from cockpit.instruments.histogram_2d_gauge import _get_xmargin_histogram_data sys.path.append(os.getcwd()) from experime...
true
true
1c3efc920c9907cf51d01d38531a5b3c94401441
1,139
py
Python
plot.py
s-gv/pymotoplus
873b967747d98d9c9e066496547aa09ce164c8a1
[ "BSD-2-Clause" ]
2
2021-08-16T07:07:43.000Z
2022-01-24T16:05:35.000Z
plot.py
s-gv/pymotoplus
873b967747d98d9c9e066496547aa09ce164c8a1
[ "BSD-2-Clause" ]
null
null
null
plot.py
s-gv/pymotoplus
873b967747d98d9c9e066496547aa09ce164c8a1
[ "BSD-2-Clause" ]
1
2021-07-19T02:28:10.000Z
2021-07-19T02:28:10.000Z
# Copyright (c) 2019 Sagar Gubbi. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import numpy as np import matplotlib import json matplotlib.use('Agg') import matplotlib.pyplot as plt def main(): rows = [] with open('log.txt') as f: ...
30.783784
118
0.565408
import numpy as np import matplotlib import json matplotlib.use('Agg') import matplotlib.pyplot as plt def main(): rows = [] with open('log.txt') as f: for line in f: if line.startswith(':u_fx:'): txt = '{"' + line[1:].strip().replace(': ', '": ').replace(', ', ', "') + '}'...
true
true
1c3efd1348ec046804b606eac521ae4e8ed3cb77
7,645
py
Python
src/json_utils.py
moreymat/demi-ou-moitie
72e3cf4a4a4db082969b5c33152ecca389214eab
[ "MIT" ]
null
null
null
src/json_utils.py
moreymat/demi-ou-moitie
72e3cf4a4a4db082969b5c33152ecca389214eab
[ "MIT" ]
4
2021-01-12T18:24:20.000Z
2021-01-20T16:03:07.000Z
src/json_utils.py
moreymat/demi-ou-moitie
72e3cf4a4a4db082969b5c33152ecca389214eab
[ "MIT" ]
null
null
null
# functions to manipulate the datas import json import io import os from pathlib import Path import json # Parameter: json_path: path to json file # # Output: a string representing the data def extract_text_from_json(json_path): with open(json_path) as json_file: data = json.load(json_file)...
31.590909
87
0.398169
import json import io import os from pathlib import Path import json def extract_text_from_json(json_path): with open(json_path) as json_file: data = json.load(json_file) result = "" print("Nombre d'arrété dans ", json_path, ": ", len(data["arretes"])) for arrete in data["a...
true
true
1c3efe1206769bebd4f2f227ff1d560751c18fc7
3,245
py
Python
training/word_vectors.py
howl-anderson/spacy-dev-resources
4ba4bea947c4bb6779066f4ef6a30decaad304e4
[ "MIT" ]
2
2018-03-14T08:49:07.000Z
2019-05-20T02:31:38.000Z
training/word_vectors.py
howl-anderson/spacy-dev-resources
4ba4bea947c4bb6779066f4ef6a30decaad304e4
[ "MIT" ]
null
null
null
training/word_vectors.py
howl-anderson/spacy-dev-resources
4ba4bea947c4bb6779066f4ef6a30decaad304e4
[ "MIT" ]
1
2020-11-06T06:02:20.000Z
2020-11-06T06:02:20.000Z
#!/usr/bin/env python from __future__ import print_function, unicode_literals, division import io import bz2 import logging from os import path import os import random from collections import defaultdict import plac try: import ujson as json except ImportError: import json from gensim.models import Word2Vec fr...
31.504854
102
0.639137
from __future__ import print_function, unicode_literals, division import io import bz2 import logging from os import path import os import random from collections import defaultdict import plac try: import ujson as json except ImportError: import json from gensim.models import Word2Vec from preshed.counter imp...
true
true
1c3efe168a0e06acb0d1c01f34daba0d3e09ab59
3,817
py
Python
fastreid/data/build.py
tenghehan/reid_without_id
d1d0ff273b1ef19fc6da8cbbf210527779b37455
[ "MIT" ]
null
null
null
fastreid/data/build.py
tenghehan/reid_without_id
d1d0ff273b1ef19fc6da8cbbf210527779b37455
[ "MIT" ]
null
null
null
fastreid/data/build.py
tenghehan/reid_without_id
d1d0ff273b1ef19fc6da8cbbf210527779b37455
[ "MIT" ]
null
null
null
# encoding: utf-8 """ @author: l1aoxingyu @contact: sherlockliao01@gmail.com """ import os import torch from torch._six import container_abcs, string_classes, int_classes from torch.utils.data import DataLoader from fastreid.utils import comm from . import samplers from .common import CommDataset from .datasets impo...
33.482456
124
0.698192
import os import torch from torch._six import container_abcs, string_classes, int_classes from torch.utils.data import DataLoader from fastreid.utils import comm from . import samplers from .common import CommDataset from .datasets import DATASET_REGISTRY from .transforms import build_transforms _root = os.getenv("F...
true
true