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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2ba2dff95300359a057ddf7d9c01dfcbbf9944 | 950 | py | Python | util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py | PLohrmannAMD/renderdoc | ea16d31aa340581f5e505e0c734a8468e5d3d47f | [
"MIT"
] | 20 | 2020-10-03T18:03:34.000Z | 2021-01-15T02:53:29.000Z | util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py | PLohrmannAMD/renderdoc | ea16d31aa340581f5e505e0c734a8468e5d3d47f | [
"MIT"
] | null | null | null | util/test/tests/D3D12/D3D12_Untyped_Backbuffer_Descriptor.py | PLohrmannAMD/renderdoc | ea16d31aa340581f5e505e0c734a8468e5d3d47f | [
"MIT"
] | 5 | 2020-10-03T18:13:37.000Z | 2021-01-15T02:53:35.000Z | import renderdoc as rd
import rdtest
class D3D12_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
demos_test_name = 'D3D12_Untyped_Backbuffer_Descriptor'
def check_capture(self):
# find the first draw
draw = self.find_draw("Draw")
self.controller.SetFrameEvent(draw.eventId, False)
... | 31.666667 | 102 | 0.685263 | import renderdoc as rd
import rdtest
class D3D12_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
demos_test_name = 'D3D12_Untyped_Backbuffer_Descriptor'
def check_capture(self):
draw = self.find_draw("Draw")
self.controller.SetFrameEvent(draw.eventId, False)
pipe: rd.PipeSt... | true | true |
1c2ba388d555fe306d4df71a24831fe113ccf007 | 408 | py | Python | powerstation_graphs/migrations/0002_auto_20180824_1503.py | Red-Teapot/bbyaworld.com-django | 6eb8febd2cfa304a062ac924240cbdf060499cfc | [
"MIT"
] | 1 | 2020-01-11T18:04:15.000Z | 2020-01-11T18:04:15.000Z | powerstation_graphs/migrations/0002_auto_20180824_1503.py | Red-Teapot/bbyaworld.com-django | 6eb8febd2cfa304a062ac924240cbdf060499cfc | [
"MIT"
] | 2 | 2018-08-24T08:53:27.000Z | 2019-07-05T16:08:28.000Z | powerstation_graphs/migrations/0002_auto_20180824_1503.py | Red-Teapot/bbyaworld.com-django | 6eb8febd2cfa304a062ac924240cbdf060499cfc | [
"MIT"
] | 1 | 2018-11-22T16:19:52.000Z | 2018-11-22T16:19:52.000Z | # Generated by Django 2.1 on 2018-08-24 12:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('powerstation_graphs', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='measurement',
name='type',
... | 21.473684 | 70 | 0.612745 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('powerstation_graphs', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='measurement',
name='type',
field=models.SmallIntegerField(db... | true | true |
1c2ba3bd05dbfd3aed897c5862514a20dd316d5f | 3,201 | py | Python | ui/nngenanticipate.py | LouisRoss/spiking-core | dd880a9d812b587172fd760813dc80c7ddc963d3 | [
"MIT"
] | null | null | null | ui/nngenanticipate.py | LouisRoss/spiking-core | dd880a9d812b587172fd760813dc80c7ddc963d3 | [
"MIT"
] | null | null | null | ui/nngenanticipate.py | LouisRoss/spiking-core | dd880a9d812b587172fd760813dc80c7ddc963d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
import collections
from pathlib import Path
from mes import configuration
# TODO make this configurable or in some other repository.
signal_delay_time = 7
class AnticipateGenerator:
configuration = None
signal_to_inject = {}
width = 50
height = 25
def __init__(sel... | 36.375 | 105 | 0.683536 |
import json
import collections
from pathlib import Path
from mes import configuration
signal_delay_time = 7
class AnticipateGenerator:
configuration = None
signal_to_inject = {}
width = 50
height = 25
def __init__(self, configuration):
self.configuration = configuration
if 'M... | true | true |
1c2ba46835cc8ddf66ba698d54ba354765070ef4 | 764 | py | Python | src/encoded/audit/dataset.py | KCL-ORG/encoded | 5a1904e948bfd652e8a8d52c6717d7fc0b56b681 | [
"MIT"
] | 4 | 2018-01-04T22:31:08.000Z | 2021-07-15T17:39:16.000Z | src/encoded/audit/dataset.py | KCL-ORG/encoded | 5a1904e948bfd652e8a8d52c6717d7fc0b56b681 | [
"MIT"
] | 7 | 2017-10-31T23:47:47.000Z | 2022-01-10T00:12:42.000Z | src/encoded/audit/dataset.py | KCL-ORG/encoded | 5a1904e948bfd652e8a8d52c6717d7fc0b56b681 | [
"MIT"
] | 10 | 2017-09-14T00:57:07.000Z | 2021-07-27T23:41:14.000Z | from snovault import (
AuditFailure,
audit_checker,
)
@audit_checker('Dataset', frame=['original_files'])
def audit_experiment_released_with_unreleased_files(value, system):
if value['status'] != 'released':
return
if 'original_files' not in value:
return
for f in value['original_f... | 34.727273 | 89 | 0.556283 | from snovault import (
AuditFailure,
audit_checker,
)
@audit_checker('Dataset', frame=['original_files'])
def audit_experiment_released_with_unreleased_files(value, system):
if value['status'] != 'released':
return
if 'original_files' not in value:
return
for f in value['original_f... | true | true |
1c2ba55d545befabf68d77a7f3dd47035c7b8290 | 8,271 | py | Python | bartpy/diagnostics/features.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | bartpy/diagnostics/features.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | bartpy/diagnostics/features.py | danielremo/bartpy | f299d8be9378daf75ee1a6b1527de5cb0f0ced89 | [
"MIT"
] | null | null | null | from collections import Counter
from typing import List, Mapping, Union, Optional
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from bartpy.runner import run_models
from bartpy.sklearnmodel import SklearnModel
ImportanceMap = Mapping[int, float]
ImportanceDistribut... | 37.089686 | 129 | 0.688309 | from collections import Counter
from typing import List, Mapping, Union, Optional
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from bartpy.runner import run_models
from bartpy.sklearnmodel import SklearnModel
ImportanceMap = Mapping[int, float]
ImportanceDistribut... | true | true |
1c2ba633bcabd078485558dc038d761e962f1c89 | 19,289 | py | Python | api/app/resources/bookings/walkin/walkin.py | krishnan-aot/queue-management | 0710ef268b288feeb7776882e618f974d4b84f6f | [
"Apache-2.0"
] | 30 | 2018-09-19T03:30:51.000Z | 2022-03-07T02:57:05.000Z | api/app/resources/bookings/walkin/walkin.py | WalterMoar/queue-management | c7698501dafebe3b5dc6bb602b5ab57ca56572a7 | [
"Apache-2.0"
] | 159 | 2018-09-17T23:45:58.000Z | 2022-03-30T17:35:05.000Z | api/app/resources/bookings/walkin/walkin.py | tyu-avo/queue-management | 0710ef268b288feeb7776882e618f974d4b84f6f | [
"Apache-2.0"
] | 52 | 2018-05-18T18:30:06.000Z | 2021-08-25T12:00:29.000Z | '''Copyright 2018 Province of British Columbia
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,... | 48.709596 | 163 | 0.54373 | import pytz
from pprint import pprint
from datetime import datetime, timedelta
from flask import request, g
from flask_restx import Resource
from qsystem import api, api_call_with_retry, db, socketio, my_print, application
from app.models.theq import Citizen, CSR, Counter, Office, CitizenState, ServiceReq
from app.mode... | true | true |
1c2ba781fe0dee311f64c8ce2ba3a983a60619d4 | 370 | py | Python | stacks/XIAOMATECH/1.0/services/INFLUXDB/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 3 | 2019-08-13T01:44:16.000Z | 2019-12-10T04:05:56.000Z | stacks/XIAOMATECH/1.0/services/INFLUXDB/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | null | null | null | stacks/XIAOMATECH/1.0/services/INFLUXDB/package/scripts/service_check.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 7 | 2019-05-29T17:35:25.000Z | 2021-12-04T07:55:10.000Z | from resource_management import *
from resource_management.libraries.script import Script
from resource_management.core.resources.system import Execute
class ServiceCheck(Script):
def service_check(self, env):
import params
env.set_params(params)
Execute('service influxdb status')
if __n... | 24.666667 | 61 | 0.745946 | from resource_management import *
from resource_management.libraries.script import Script
from resource_management.core.resources.system import Execute
class ServiceCheck(Script):
def service_check(self, env):
import params
env.set_params(params)
Execute('service influxdb status')
if __n... | true | true |
1c2ba9fb743c59f44b67814ab32a615a45a43d26 | 824 | py | Python | tests/reducers/test_setting_reducers.py | mlopezantequera/pytorch-metric-learning | 17fe941c5f8ff1177c577d94518bf01a8d035747 | [
"MIT"
] | null | null | null | tests/reducers/test_setting_reducers.py | mlopezantequera/pytorch-metric-learning | 17fe941c5f8ff1177c577d94518bf01a8d035747 | [
"MIT"
] | null | null | null | tests/reducers/test_setting_reducers.py | mlopezantequera/pytorch-metric-learning | 17fe941c5f8ff1177c577d94518bf01a8d035747 | [
"MIT"
] | null | null | null | import unittest
from pytorch_metric_learning.losses import ContrastiveLoss, TripletMarginLoss
from pytorch_metric_learning.reducers import (AvgNonZeroReducer, MeanReducer,
ThresholdReducer)
class TestSettingReducers(unittest.TestCase):
def test_setting_reducers(self)... | 37.454545 | 77 | 0.571602 | import unittest
from pytorch_metric_learning.losses import ContrastiveLoss, TripletMarginLoss
from pytorch_metric_learning.reducers import (AvgNonZeroReducer, MeanReducer,
ThresholdReducer)
class TestSettingReducers(unittest.TestCase):
def test_setting_reducers(self)... | true | true |
1c2baa35cd37cff6bc63bf7d8ff088a3dc1ef5a1 | 528 | py | Python | DAIN/my_package/SeparableConv/setup.py | mpriessner/VFIN | a027c02cc9e28a4db493358654dc5f1ef7928fe2 | [
"MIT"
] | 8 | 2021-11-03T20:21:35.000Z | 2021-12-06T14:53:13.000Z | DAIN/my_package/SeparableConv/setup.py | mpriessner/VFIN | a027c02cc9e28a4db493358654dc5f1ef7928fe2 | [
"MIT"
] | 3 | 2021-11-17T16:46:48.000Z | 2021-11-18T20:57:49.000Z | DAIN/my_package/SeparableConv/setup.py | mpriessner/VFIN | a027c02cc9e28a4db493358654dc5f1ef7928fe2 | [
"MIT"
] | 2 | 2021-12-03T13:10:11.000Z | 2021-12-20T11:06:25.000Z | import os
import json
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
import torch
with open('../../compiler_args.json') as f:
extra_compile_args = json.load(f)
setup(
name='separableconv_cuda',
ext_modules=[
CUDAExtension('separablec... | 25.142857 | 67 | 0.691288 | import os
import json
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
import torch
with open('../../compiler_args.json') as f:
extra_compile_args = json.load(f)
setup(
name='separableconv_cuda',
ext_modules=[
CUDAExtension('separablec... | true | true |
1c2bab093580a45c29e395e0ee2a8e16331e5f1d | 7,116 | py | Python | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 149 | 2019-12-13T21:12:36.000Z | 2022-03-26T09:56:31.000Z | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 200 | 2020-06-18T17:30:58.000Z | 2022-03-30T09:54:59.000Z | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 23 | 2019-12-12T14:36:49.000Z | 2022-03-29T07:11:28.000Z | # -*- coding: utf-8 -*-
# Copyright 2021, CS GROUP - France, https://www.csgroup.eu/
#
# This file is part of EODAG project
# https://www.github.com/CS-SI/EODAG
#
# 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 c... | 42.610778 | 111 | 0.56113 |
import logging
from eodag.plugins.crunch.base import Crunch
from eodag.utils import get_geometry_from_various
try:
from shapely.errors import TopologicalError
except ImportError:
from shapely.geos import TopologicalError
logger = logging.getLogger("eodag.plugins.crunch.filter_overlap")
c... | true | true |
1c2bab35007c0e16616799e219263ce48e7899b7 | 367 | py | Python | src/schnetpack/nn/activations.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | 450 | 2018-09-04T08:37:47.000Z | 2022-03-30T08:05:37.000Z | src/schnetpack/nn/activations.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | 239 | 2018-09-11T21:09:08.000Z | 2022-03-18T09:25:11.000Z | src/schnetpack/nn/activations.py | giadefa/schnetpack | 9dabc3b6e3b28deb2fb3743ea1857c46b055efbf | [
"MIT"
] | 166 | 2018-09-13T13:01:06.000Z | 2022-03-31T12:59:12.000Z | import numpy as np
from torch.nn import functional
def shifted_softplus(x):
r"""Compute shifted soft-plus activation function.
.. math::
y = \ln\left(1 + e^{-x}\right) - \ln(2)
Args:
x (torch.Tensor): input tensor.
Returns:
torch.Tensor: shifted soft-plus of input.
"""
... | 19.315789 | 54 | 0.610354 | import numpy as np
from torch.nn import functional
def shifted_softplus(x):
return functional.softplus(x) - np.log(2.0)
| true | true |
1c2baba36a7a089cd7f46d3bf45a67d99c349331 | 757 | py | Python | datasets/cifar10.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | 74 | 2021-02-04T14:28:49.000Z | 2022-03-23T16:12:18.000Z | datasets/cifar10.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | 7 | 2021-02-28T03:29:12.000Z | 2022-02-16T14:33:06.000Z | datasets/cifar10.py | mtyhon/ckconv | 056ec93c039e8bcda89f07ff9fdece3e7373b0bf | [
"MIT"
] | 6 | 2021-02-12T14:43:15.000Z | 2021-08-11T02:42:31.000Z | from torchvision import datasets, transforms
class CIFAR10(datasets.CIFAR10): # TODO: Documentation
def __init__(
self,
partition: str,
**kwargs,
):
root = "./data"
transform = transforms.Compose(
[
transforms.ToTensor(),
tr... | 27.035714 | 84 | 0.52576 | from torchvision import datasets, transforms
class CIFAR10(datasets.CIFAR10):
def __init__(
self,
partition: str,
**kwargs,
):
root = "./data"
transform = transforms.Compose(
[
transforms.ToTensor(),
transforms.Normalize((0... | true | true |
1c2bac34ad8c76ff7ae97490b476c068a8bdcead | 5,000 | py | Python | docs/source/conf.py | remz1337/LGP | aac633fbd1305f699973c1bfe7db4603195f8dfa | [
"MIT"
] | 15 | 2017-05-12T13:20:38.000Z | 2021-09-27T05:09:37.000Z | docs/source/conf.py | remz1337/LGP | aac633fbd1305f699973c1bfe7db4603195f8dfa | [
"MIT"
] | 35 | 2017-04-20T04:57:45.000Z | 2022-03-20T05:34:33.000Z | docs/source/conf.py | remz1337/LGP | aac633fbd1305f699973c1bfe7db4603195f8dfa | [
"MIT"
] | 4 | 2018-11-02T00:35:33.000Z | 2020-09-29T00:59:32.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# LGP documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 19 11:42:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | 28.571429 | 79 | 0.6698 |
extensions = [
'sphinx.ext.mathjax',
'sphinx.ext.githubpages'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'LGP'
copyright = '2017, Jed Simson'
author = 'Jed Simson'
# |version| and |release|, also used in various other place... | true | true |
1c2bac51ebfee79ae18de2be4e3e8de544345b1d | 5,210 | py | Python | nodular_JJ/finite_sc/phase_diagrams/fxd_gam_gap.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | null | null | null | nodular_JJ/finite_sc/phase_diagrams/fxd_gam_gap.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 2 | 2020-03-24T23:46:17.000Z | 2020-04-19T20:29:08.000Z | nodular_JJ/finite_sc/phase_diagrams/fxd_gam_gap.py | tbcole/majoranaJJ | dcf31f7786fa0a4874a940b7d8dcdd55f3921a46 | [
"MIT"
] | 3 | 2020-04-30T08:48:12.000Z | 2022-01-26T12:15:15.000Z | import sys
import time
import os
import gc
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.signal import argrelextrema
import scipy.linalg as LA
import scipy.sparse.linalg as spLA
import majoranaJJ.operators.sparse_operators as spop #sparse operators
from majoranaJJ.operators.... | 43.057851 | 282 | 0.604223 | import sys
import time
import os
import gc
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.signal import argrelextrema
import scipy.linalg as LA
import scipy.sparse.linalg as spLA
import majoranaJJ.operators.sparse_operators as spop
from majoranaJJ.operators.potentials import... | true | true |
1c2bac807284f98d90b280bb37eeb8993e2597bb | 6,381 | py | Python | jigsaw19/roberta_large3/train/train.py | GuanshuoXu/Jigsaw-Rate-Severity-of-Toxic-Comments | 84243994c70124d1a529bb6931f579f7d185d64c | [
"MIT"
] | 49 | 2022-02-08T21:34:37.000Z | 2022-03-31T17:31:45.000Z | jigsaw19/roberta_large3/train/train.py | xiaobenla/Jigsaw-Rate-Severity-of-Toxic-Comments | 84243994c70124d1a529bb6931f579f7d185d64c | [
"MIT"
] | 1 | 2022-03-21T13:48:01.000Z | 2022-03-21T13:48:01.000Z | jigsaw19/roberta_large3/train/train.py | xiaobenla/Jigsaw-Rate-Severity-of-Toxic-Comments | 84243994c70124d1a529bb6931f579f7d185d64c | [
"MIT"
] | 14 | 2022-02-08T21:34:39.000Z | 2022-03-01T00:44:18.000Z | import argparse
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torch
import random
import pickle
from ... | 38.209581 | 150 | 0.645197 | import argparse
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torch
import random
import pickle
from ... | true | true |
1c2bacc2932662969a4085cb1c52e06980fd3539 | 2,395 | py | Python | ipinfo.py | abuelacantora/judas | 722f04ec44069b73600b80a99fa2d7fb1886b5a5 | [
"MIT"
] | null | null | null | ipinfo.py | abuelacantora/judas | 722f04ec44069b73600b80a99fa2d7fb1886b5a5 | [
"MIT"
] | null | null | null | ipinfo.py | abuelacantora/judas | 722f04ec44069b73600b80a99fa2d7fb1886b5a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Gets info on IP address (IPv4 or IPv6) from http://ipinfo.io/
# Source: https://github.com/sanderjo/ipinfo.git
# GPL3
'''
Based on this public API from http://ipinfo.io/ :
$ curl http://ipinfo.io/31.21.30.159/json
{
"ip": "31.21.30.159",
"hostname": "No Hostname",
"city": "",
"region"... | 25.210526 | 87 | 0.610438 |
import json
import urllib
import re
baseurl = 'http://api.ipapi.com'
def ispublic(ipaddress):
return not isprivate(ipaddress)
def isprivate(ipaddress):
if ipaddress.startswith("::ffff:"):
ipaddress=ipaddress.replace("::ffff:", "")
if re.search(r"^(?:10|127|172\.(?:1[6-9]|2[0-9]... | true | true |
1c2bad54eb4e97edcefe58d45791dbff64e10082 | 627 | py | Python | solutions/007/007.py | vicaal/daily-coding-problem | 351436363575c303ceff56236f193e3c3c20fcd3 | [
"MIT"
] | null | null | null | solutions/007/007.py | vicaal/daily-coding-problem | 351436363575c303ceff56236f193e3c3c20fcd3 | [
"MIT"
] | null | null | null | solutions/007/007.py | vicaal/daily-coding-problem | 351436363575c303ceff56236f193e3c3c20fcd3 | [
"MIT"
] | null | null | null |
def valid_character(number):
return True if int(number) > 0 and int(number) < 27 else False
def solve(message):
if message == '':
return 1
else:
number_of_solutions = 0
if valid_character(message[:1]):
number_of_solutions += (solve(message[1:]))
if len(message... | 23.222222 | 66 | 0.61244 |
def valid_character(number):
return True if int(number) > 0 and int(number) < 27 else False
def solve(message):
if message == '':
return 1
else:
number_of_solutions = 0
if valid_character(message[:1]):
number_of_solutions += (solve(message[1:]))
if len(message... | true | true |
1c2bae9d0e78a12065a8ee588ab65cb01f497586 | 1,507 | py | Python | pv_vision/tools/im_move.py | hackingmaterials/pv_vision | a42be9b55da4a2384602bc456989cef1324edab1 | [
"BSD-3-Clause"
] | 12 | 2020-11-11T22:59:28.000Z | 2022-03-21T08:52:43.000Z | pv_vision/tools/im_move.py | hackingmaterials/pv_vision | a42be9b55da4a2384602bc456989cef1324edab1 | [
"BSD-3-Clause"
] | 4 | 2021-02-01T22:18:59.000Z | 2022-03-14T00:41:57.000Z | pv_vision/tools/im_move.py | hackingmaterials/pv_vision | a42be9b55da4a2384602bc456989cef1324edab1 | [
"BSD-3-Clause"
] | 3 | 2021-01-23T00:58:46.000Z | 2022-01-10T21:17:07.000Z | import csv
import os
import shutil
import argparse
from pathlib import Path
from tqdm import tqdm
def im_move(im_folder_path, csv_path, subfolders, parentfolder='classified_images', im_extension=None):
"""Move the source images into subfolders based on their categories.
Parameters
----------
im_folde... | 32.76087 | 103 | 0.678832 | import csv
import os
import shutil
import argparse
from pathlib import Path
from tqdm import tqdm
def im_move(im_folder_path, csv_path, subfolders, parentfolder='classified_images', im_extension=None):
if not im_extension:
image = os.listdir(im_folder_path)[0]
im_extension = os.path.splitext(image... | true | true |
1c2baf6a358cd9fd2d8127bad96dc8f8f8625f5a | 20,938 | py | Python | tests/standalone/run_all.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | tests/standalone/run_all.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | tests/standalone/run_all.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# ... | 34.4375 | 96 | 0.50406 |
# indicated.
#
# 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 t... | true | true |
1c2baf6f26f1c7e0daf213dfbbb84217a5ff2939 | 1,025 | py | Python | tests_app/tests/functional/routers/extended_default_router/tests.py | sahithi-rp/drf-extensions | 00712396be979aaa5a86246bee39284b5e5e8d71 | [
"MIT"
] | null | null | null | tests_app/tests/functional/routers/extended_default_router/tests.py | sahithi-rp/drf-extensions | 00712396be979aaa5a86246bee39284b5e5e8d71 | [
"MIT"
] | null | null | null | tests_app/tests/functional/routers/extended_default_router/tests.py | sahithi-rp/drf-extensions | 00712396be979aaa5a86246bee39284b5e5e8d71 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.test import override_settings
from django.urls import NoReverseMatch
from rest_framework_extensions.test import APITestCase
@override_settings(ROOT_URLCONF='tests_app.tests.functional.routers.extended_default_router.urls')
class ExtendedDefaultRouterTestBehaviour(APITestCase):
... | 39.423077 | 117 | 0.676098 |
from django.test import override_settings
from django.urls import NoReverseMatch
from rest_framework_extensions.test import APITestCase
@override_settings(ROOT_URLCONF='tests_app.tests.functional.routers.extended_default_router.urls')
class ExtendedDefaultRouterTestBehaviour(APITestCase):
def test_index_page(s... | true | true |
1c2baf708977f783b57c7c1667b3d161745384f8 | 2,577 | py | Python | VoiceAssistant/Project_Basic_struct/VoiceAssistant_main.py | TheRealMilesLee/Python | d145c848a7ba76e8e523e4fe06e2a0add7e2fae1 | [
"MIT"
] | 1 | 2018-12-05T11:04:47.000Z | 2018-12-05T11:04:47.000Z | VoiceAssistant/Project_Basic_struct/VoiceAssistant_main.py | MarkHooland/Python | d145c848a7ba76e8e523e4fe06e2a0add7e2fae1 | [
"MIT"
] | null | null | null | VoiceAssistant/Project_Basic_struct/VoiceAssistant_main.py | MarkHooland/Python | d145c848a7ba76e8e523e4fe06e2a0add7e2fae1 | [
"MIT"
] | null | null | null | from speakListen import *
from websiteWork import *
from textRead import *
from dictator import *
from menu import *
from speechtotext import *
from TextTospeech import *
def main():
start = 0
end = 0
if start == 0:
print("\nSay \"Hello Python\" to activate the Voice Assistant!")
... | 32.620253 | 158 | 0.407451 | from speakListen import *
from websiteWork import *
from textRead import *
from dictator import *
from menu import *
from speechtotext import *
from TextTospeech import *
def main():
start = 0
end = 0
if start == 0:
print("\nSay \"Hello Python\" to activate the Voice Assistant!")
... | true | true |
1c2bafbebe89cb5ab07084b754d3e2b0ca72021c | 4,004 | py | Python | tests/unit/clients/python/test_client.py | facebbook/jina | e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873 | [
"Apache-2.0"
] | null | null | null | tests/unit/clients/python/test_client.py | facebbook/jina | e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873 | [
"Apache-2.0"
] | 2 | 2021-02-15T01:40:38.000Z | 2021-02-15T02:00:21.000Z | tests/unit/clients/python/test_client.py | facebbook/jina | e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873 | [
"Apache-2.0"
] | null | null | null | import os
import time
import pytest
import requests
from jina.clients import Client
from jina.clients.sugary_io import _input_files
from jina.excepts import BadClientInput
from jina.flow import Flow
from jina import helper
from jina.parsers import set_gateway_parser
from jina.peapods import Pea
from jina.proto.jina_p... | 35.122807 | 399 | 0.724276 | import os
import time
import pytest
import requests
from jina.clients import Client
from jina.clients.sugary_io import _input_files
from jina.excepts import BadClientInput
from jina.flow import Flow
from jina import helper
from jina.parsers import set_gateway_parser
from jina.peapods import Pea
from jina.proto.jina_p... | true | true |
1c2bafd39110a18198ed8febd96622814ea3167d | 4,565 | py | Python | Python/Host/easy_lidar.py | henrymidles/LidarBot | f67b5ed77671abad7267a86f425192fc6d5aad42 | [
"MIT"
] | null | null | null | Python/Host/easy_lidar.py | henrymidles/LidarBot | f67b5ed77671abad7267a86f425192fc6d5aad42 | [
"MIT"
] | null | null | null | Python/Host/easy_lidar.py | henrymidles/LidarBot | f67b5ed77671abad7267a86f425192fc6d5aad42 | [
"MIT"
] | null | null | null | import time
import random
import struct
import serial
class Lidar():
def __init__(self, port='/dev/ttyUSB0'):
self.lidar = None
self.port = port
self.baud = 128000
def start(self):
self.lidar = serial.Serial(self.port, self.baud)
def stop(self):
if self.lidar !... | 34.323308 | 89 | 0.614677 | import time
import random
import struct
import serial
class Lidar():
def __init__(self, port='/dev/ttyUSB0'):
self.lidar = None
self.port = port
self.baud = 128000
def start(self):
self.lidar = serial.Serial(self.port, self.baud)
def stop(self):
if self.lidar !... | true | true |
1c2bb138f1d57f3a7862052c16931f2e0822b233 | 704 | py | Python | breathe/path_handler.py | 2bndy5/breathe | d3022c1017ff44575b6cec7f017b68719d3e4480 | [
"BSD-3-Clause"
] | null | null | null | breathe/path_handler.py | 2bndy5/breathe | d3022c1017ff44575b6cec7f017b68719d3e4480 | [
"BSD-3-Clause"
] | null | null | null | breathe/path_handler.py | 2bndy5/breathe | d3022c1017ff44575b6cec7f017b68719d3e4480 | [
"BSD-3-Clause"
] | null | null | null | from sphinx.application import Sphinx
import os
def includes_directory(file_path: str):
# Check for backslash or forward slash as we don't know what platform we're on and sometimes
# the doxygen paths will have forward slash even on Windows.
return bool(file_path.count("\\")) or bool(file_path.count("/")... | 37.052632 | 96 | 0.738636 | from sphinx.application import Sphinx
import os
def includes_directory(file_path: str):
return bool(file_path.count("\\")) or bool(file_path.count("/"))
def resolve_path(app: Sphinx, directory: str, filename: str):
return os.path.join(app.confdir, directory, filename)
| true | true |
1c2bb18f2deebaaeae20a1d1afaae3aec8d4710f | 1,674 | py | Python | setup.py | xu183255/planetutils | 07554a4f7d2f30c8a3967d732997f5e1076205d0 | [
"MIT"
] | null | null | null | setup.py | xu183255/planetutils | 07554a4f7d2f30c8a3967d732997f5e1076205d0 | [
"MIT"
] | null | null | null | setup.py | xu183255/planetutils | 07554a4f7d2f30c8a3967d732997f5e1076205d0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='interline-planetutils',
v... | 38.930233 | 81 | 0.685185 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='interline-planetutils',
version='0.4.8',
description='Interline Plan... | true | true |
1c2bb1fbe68365151ed8763afe3a628c2a484dba | 30,744 | py | Python | ignite/contrib/handlers/clearml_logger.py | rushabh-v/ignite | bfdcfa43108b37ef0423899941530744124aae67 | [
"BSD-3-Clause"
] | 1 | 2021-08-30T14:29:10.000Z | 2021-08-30T14:29:10.000Z | ignite/contrib/handlers/clearml_logger.py | rushabh-v/ignite | bfdcfa43108b37ef0423899941530744124aae67 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/handlers/clearml_logger.py | rushabh-v/ignite | bfdcfa43108b37ef0423899941530744124aae67 | [
"BSD-3-Clause"
] | null | null | null | """ClearML logger and its helper handlers."""
import numbers
import os
import tempfile
import warnings
from collections import defaultdict
from datetime import datetime
from enum import Enum
from typing import Any, Callable, DefaultDict, List, Mapping, Optional, Tuple, Type, Union
import torch
from torch.nn import Mod... | 37.538462 | 120 | 0.612217 | import numbers
import os
import tempfile
import warnings
from collections import defaultdict
from datetime import datetime
from enum import Enum
from typing import Any, Callable, DefaultDict, List, Mapping, Optional, Tuple, Type, Union
import torch
from torch.nn import Module
from torch.optim import Optimizer
import ... | true | true |
1c2bb21e9f8d5ea373a0cada2c3f86a2a57f2c62 | 163 | py | Python | examples/if_oneliner.py | personal-army-of-4o/nyanMigen | 205e114d47495a3c7c885556ffa0ebe386e9b9fc | [
"BSD-3-Clause"
] | 4 | 2021-02-26T17:20:44.000Z | 2021-04-15T07:41:31.000Z | examples/if_oneliner.py | personal-army-of-4o/nyanMigen | 205e114d47495a3c7c885556ffa0ebe386e9b9fc | [
"BSD-3-Clause"
] | 121 | 2021-02-18T07:24:22.000Z | 2021-07-19T14:24:51.000Z | examples/if_oneliner.py | personal-army-of-4o/nyanMigen | 205e114d47495a3c7c885556ffa0ebe386e9b9fc | [
"BSD-3-Clause"
] | null | null | null |
from nyanMigen import nyanify
@nyanify
class if_oneliner:
def elaborate(self, platform):
a = Signal()
b = Signal()
a = 1 if b else 0
| 16.3 | 34 | 0.595092 |
from nyanMigen import nyanify
@nyanify
class if_oneliner:
def elaborate(self, platform):
a = Signal()
b = Signal()
a = 1 if b else 0
| true | true |
1c2bb30ea4f7632e975191f0c33e42994bfeddb2 | 7,983 | py | Python | labtex/unit.py | CianLM/labtex | cb8233d762f62825c466fbdb050334f743847aaa | [
"MIT"
] | 4 | 2021-07-10T13:28:48.000Z | 2021-09-04T07:06:18.000Z | labtex/unit.py | CianLM/labtex | cb8233d762f62825c466fbdb050334f743847aaa | [
"MIT"
] | null | null | null | labtex/unit.py | CianLM/labtex | cb8233d762f62825c466fbdb050334f743847aaa | [
"MIT"
] | null | null | null | import re
from typing import Union
import math
# TODO
# MeasurementList type compatability
class Unit:
"SI Unit taking in a string."
def __init__(self,unitString: Union[str,dict]):
Unit.knownUnits = ['g','s','A','K','C','J','V','N','W','T','Pa','Hz','m']
Unit.prefixes = {'n':1e-9,'u':1e-6,'m'... | 42.919355 | 186 | 0.507829 | import re
from typing import Union
import math
class Unit:
def __init__(self,unitString: Union[str,dict]):
Unit.knownUnits = ['g','s','A','K','C','J','V','N','W','T','Pa','Hz','m']
Unit.prefixes = {'n':1e-9,'u':1e-6,'m':1e-3,'c':1e-2,'':1,'k':1e3,'M':1e6,'G':1e9}
if(ty... | true | true |
1c2bb33a3b8e73cc82ea9b94f589fefd41185f7c | 393 | py | Python | api/views.py | MosenzonTal/Cloudi | 65bb04c50584b02f909bf84d6323a9c6a02e819b | [
"FSFAP"
] | null | null | null | api/views.py | MosenzonTal/Cloudi | 65bb04c50584b02f909bf84d6323a9c6a02e819b | [
"FSFAP"
] | null | null | null | api/views.py | MosenzonTal/Cloudi | 65bb04c50584b02f909bf84d6323a9c6a02e819b | [
"FSFAP"
] | 1 | 2021-07-04T10:51:54.000Z | 2021-07-04T10:51:54.000Z | from rest_framework import viewsets
from cloudinis.models import ActivatedPolicy, Violation
from .serializers import *
class ActivatedPolicyView(viewsets.ModelViewSet):
queryset = ActivatedPolicy.objects.all()
serializer_class = ActivatedPolicySerializer
class ViolationView(viewsets.ModelViewSet):
query... | 28.071429 | 55 | 0.814249 | from rest_framework import viewsets
from cloudinis.models import ActivatedPolicy, Violation
from .serializers import *
class ActivatedPolicyView(viewsets.ModelViewSet):
queryset = ActivatedPolicy.objects.all()
serializer_class = ActivatedPolicySerializer
class ViolationView(viewsets.ModelViewSet):
query... | true | true |
1c2bb39539fa4821abad2e9a2b3c423d36ef5556 | 31,431 | py | Python | test-models/tf-models-r1.11/official/resnet/resnet_run_loop_hvd_imagenet_300.py | Shigangli/eager-SGD | d96905ae5c88ab65fb0c7aa064d7937ca131799f | [
"Apache-2.0"
] | 6 | 2020-06-04T07:14:11.000Z | 2021-09-24T05:50:24.000Z | test-models/tf-models-r1.11/official/resnet/resnet_run_loop_hvd_imagenet_300.py | Shigangli/eager-SGD | d96905ae5c88ab65fb0c7aa064d7937ca131799f | [
"Apache-2.0"
] | 1 | 2021-03-31T22:01:00.000Z | 2021-03-31T22:01:00.000Z | test-models/tf-models-r1.11/official/resnet/resnet_run_loop_hvd_imagenet_300.py | Shigangli/eager-SGD | d96905ae5c88ab65fb0c7aa064d7937ca131799f | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow 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 applica... | 41.520476 | 105 | 0.698101 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
from absl import flags
import tensorflow as tf
import time
import numpy as np
from official.resnet import resnet_model, lars_util
from official.utils.flags import core ... | true | true |
1c2bb485d101f7ef12bd988d60f030b89e99a2d2 | 3,508 | py | Python | sphinx_copybutton/__init__.py | pradyunsg/sphinx-copybutton | bdfc41e933582040c7e88a7c751a9558f2161d8c | [
"MIT"
] | 3 | 2020-04-25T19:31:27.000Z | 2020-04-27T14:53:46.000Z | sphinx_copybutton/__init__.py | pradyunsg/sphinx-copybutton | bdfc41e933582040c7e88a7c751a9558f2161d8c | [
"MIT"
] | 3 | 2020-04-21T22:46:51.000Z | 2020-04-23T22:37:53.000Z | sphinx_copybutton/__init__.py | pradyunsg/sphinx-copybutton | bdfc41e933582040c7e88a7c751a9558f2161d8c | [
"MIT"
] | 1 | 2020-04-23T22:14:31.000Z | 2020-04-23T22:14:31.000Z | """A small sphinx extension to add "copy" buttons to code blocks."""
from pathlib import Path
from sphinx.util import logging
__version__ = "0.5.0"
logger = logging.getLogger(__name__)
def scb_static_path(app):
app.config.html_static_path.append(
str(Path(__file__).parent.joinpath("_static").absolute())... | 35.434343 | 87 | 0.698689 | from pathlib import Path
from sphinx.util import logging
__version__ = "0.5.0"
logger = logging.getLogger(__name__)
def scb_static_path(app):
app.config.html_static_path.append(
str(Path(__file__).parent.joinpath("_static").absolute())
)
def add_to_context(app, config):
config.html_contex... | true | true |
1c2bb53468dda3156f8e214524049297c4e53b9c | 21,752 | py | Python | zerver/tests/test_presence.py | umairwaheed/zulip | 25a71853da7f51582caddca0a0bcd680f029ada3 | [
"Apache-2.0"
] | 1 | 2021-11-26T04:49:14.000Z | 2021-11-26T04:49:14.000Z | zerver/tests/test_presence.py | umairwaheed/zulip | 25a71853da7f51582caddca0a0bcd680f029ada3 | [
"Apache-2.0"
] | 2 | 2017-06-19T04:40:37.000Z | 2017-06-27T06:58:11.000Z | zerver/tests/test_presence.py | umairwaheed/zulip | 25a71853da7f51582caddca0a0bcd680f029ada3 | [
"Apache-2.0"
] | 2 | 2017-03-30T14:33:59.000Z | 2021-06-17T17:04:58.000Z | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.http import HttpResponse
from django.test import override_settings
from django.utils.timezone import now as timezone_now
from mock import mock
from typing import Any, Dict
from zerver.lib.actions import do_deactivate_user
from zerver.lib.statistics im... | 44.57377 | 121 | 0.634884 |
from datetime import timedelta
from django.http import HttpResponse
from django.test import override_settings
from django.utils.timezone import now as timezone_now
from mock import mock
from typing import Any, Dict
from zerver.lib.actions import do_deactivate_user
from zerver.lib.statistics import seconds_usage_betw... | true | true |
1c2bb5b0e721c62019d5c1c9ee7c7982aa312788 | 10,522 | py | Python | esmvaltool/diag_scripts/aerosols/diagnostics_burden.py | RCHG/ESMValTool | c6458c72777f22b52b2dcde73749a47e407b77f0 | [
"Apache-2.0"
] | null | null | null | esmvaltool/diag_scripts/aerosols/diagnostics_burden.py | RCHG/ESMValTool | c6458c72777f22b52b2dcde73749a47e407b77f0 | [
"Apache-2.0"
] | null | null | null | esmvaltool/diag_scripts/aerosols/diagnostics_burden.py | RCHG/ESMValTool | c6458c72777f22b52b2dcde73749a47e407b77f0 | [
"Apache-2.0"
] | null | null | null | """
Diagnostics to estimate aerosols burden analysis.
Author: Ramiro Checa-Garcia (LSCE-IPSL)
rcheca@lsce.ipsl.fr
Method:
- It estimates global mean values and create time series
with monthly and yearly time resolution.
Variables:
- emidust, emisoa, emiss etc to estimate emission flux
- dr... | 37.049296 | 116 | 0.614332 |
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import iris
import matplotlib.pyplot as plt
from esmvaltool.diag_scripts.shared import run_diagnostic
from esmvaltool.preprocessor._area_pp import area_average
from esmvaltool.diag_scripts.shared import (group_metadata, run_diagnostic,
... | true | true |
1c2bb7e242a344b192039843a26470b232e4eb61 | 12,935 | py | Python | Material/CityTowerProblem/CODE/TowerPlanning.py | pragneshrana/NumericalOptimization | 28ea55840ed95262bc39c0896acee9e54cc375c2 | [
"MIT"
] | null | null | null | Material/CityTowerProblem/CODE/TowerPlanning.py | pragneshrana/NumericalOptimization | 28ea55840ed95262bc39c0896acee9e54cc375c2 | [
"MIT"
] | null | null | null | Material/CityTowerProblem/CODE/TowerPlanning.py | pragneshrana/NumericalOptimization | 28ea55840ed95262bc39c0896acee9e54cc375c2 | [
"MIT"
] | null | null | null | #calling libraries
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from scipy.spatial import Voronoi, voronoi_plot_2d
import random
import pandas as pd
import sys
import os
from datetime import date
import time
class TowerPlanning():
def __init__(self,dim,main_cities,total_population,min_c,ma... | 33.861257 | 214 | 0.716351 |
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
from scipy.spatial import Voronoi, voronoi_plot_2d
import random
import pandas as pd
import sys
import os
from datetime import date
import time
class TowerPlanning():
def __init__(self,dim,main_cities,total_population,min_c,max_c,budget,Require... | true | true |
1c2bb89713d56d2561fb50de42b707d4de73ea39 | 12,543 | py | Python | cea/bigmacc/wesbrook_DH_single.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | cea/bigmacc/wesbrook_DH_single.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | cea/bigmacc/wesbrook_DH_single.py | justinfmccarty/CityEnergyAnalyst_bigmacc | a7f2d6085e83730bdc4bcb2321e1613070372027 | [
"MIT"
] | null | null | null | """
Wesbrook has a DH system fed first by heat pumps using waste and alst by NG peaking boilers. This script takes the
demand calculated by the CEA and reinterprets it for this system, outputting the results directly into the CEA
demand files.
"""
import pandas as pd
import time
import logging
logging.getLogger('numba... | 42.375 | 119 | 0.640836 |
import pandas as pd
import time
import logging
logging.getLogger('numba').setLevel(logging.WARNING)
from itertools import repeat
import cea.utilities.parallel
import cea.config
import cea.utilities
import cea.inputlocator
import cea.demand.demand_main
import cea.resources.radiation_daysim.radiation_main
import cea.big... | true | true |
1c2bb8a3a99295fae2abd825d2b16e03dfeccb98 | 13,691 | py | Python | short-read-mngs/idseq-dag/idseq_dag/steps/run_validate_input.py | chanzuckerberg/idseq-workflows | b1e7c91e5d9f0d9a05f97f240211fcc16d33225b | [
"MIT"
] | 30 | 2020-05-23T21:23:38.000Z | 2022-03-24T17:18:47.000Z | short-read-mngs/idseq-dag/idseq_dag/steps/run_validate_input.py | grunwaldlab/idseq-workflows | cacfaa02f014ba06b8fb69e62911ab7fd5d88d9a | [
"MIT"
] | 65 | 2020-05-27T14:21:26.000Z | 2021-11-18T17:58:56.000Z | short-read-mngs/idseq-dag/idseq_dag/steps/run_validate_input.py | grunwaldlab/idseq-workflows | cacfaa02f014ba06b8fb69e62911ab7fd5d88d9a | [
"MIT"
] | 12 | 2020-08-24T12:00:28.000Z | 2022-02-03T08:28:02.000Z | import json
import os
from idseq_dag.engine.pipeline_step import PipelineStep
from idseq_dag.exceptions import InvalidFileFormatError, InsufficientReadsError
import idseq_dag.util.command as command
import idseq_dag.util.command_patterns as command_patterns
import idseq_dag.util.count as count
import idseq_dag.util.va... | 46.253378 | 238 | 0.536119 | import json
import os
from idseq_dag.engine.pipeline_step import PipelineStep
from idseq_dag.exceptions import InvalidFileFormatError, InsufficientReadsError
import idseq_dag.util.command as command
import idseq_dag.util.command_patterns as command_patterns
import idseq_dag.util.count as count
import idseq_dag.util.va... | true | true |
1c2bb8a98c077606cc899d45686c3cf5e5870630 | 321 | py | Python | settings_prod.py | pryny/django_shop_alex | 3c04aab7573734a82a969ec152c3986ed240ab8d | [
"Apache-2.0"
] | null | null | null | settings_prod.py | pryny/django_shop_alex | 3c04aab7573734a82a969ec152c3986ed240ab8d | [
"Apache-2.0"
] | null | null | null | settings_prod.py | pryny/django_shop_alex | 3c04aab7573734a82a969ec152c3986ed240ab8d | [
"Apache-2.0"
] | null | null | null | DEBUG = False
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db1',
'USER': 'alex',
'PASSWORD': 'asdewqr1',
'HOST': 'localhost', # Set to empty string for localhost.
'PORT': '', # Set to empty string for default.
}
... | 26.75 | 62 | 0.566978 | DEBUG = False
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db1',
'USER': 'alex',
'PASSWORD': 'asdewqr1',
'HOST': 'localhost',
'PORT': '',
}
} | true | true |
1c2bb8b70e8aee984db365fa62cfda1a098c013c | 1,121 | py | Python | manipulateWindowExample.py | KevinRohn/py-window-manipulation | ec4cfb4d3baa027071bd1dc111278e75a9b784a3 | [
"MIT"
] | null | null | null | manipulateWindowExample.py | KevinRohn/py-window-manipulation | ec4cfb4d3baa027071bd1dc111278e75a9b784a3 | [
"MIT"
] | null | null | null | manipulateWindowExample.py | KevinRohn/py-window-manipulation | ec4cfb4d3baa027071bd1dc111278e75a9b784a3 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.getcwd()+ r"\modules")
import WMM
import time
import subprocess
w = WMM.WindowManipulationManager()
def startProgram(programm="", args=""):
subprocess.Popen(programm+"" + args+ "")
def renameWindow(title=""):
w.set_window_title(title)
def findWindow():
if w.find_win... | 26.069767 | 165 | 0.648528 | import sys, os
sys.path.append(os.getcwd()+ r"\modules")
import WMM
import time
import subprocess
w = WMM.WindowManipulationManager()
def startProgram(programm="", args=""):
subprocess.Popen(programm+"" + args+ "")
def renameWindow(title=""):
w.set_window_title(title)
def findWindow():
if w.find_win... | true | true |
1c2bb8c955cb5b0c1b40aa00ae5b9ae97aab9bbe | 2,617 | py | Python | setup.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | setup.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | setup.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | """
Setup script for imageio-ffmpeg.
"""
import os
import sys
from setuptools import setup
this_dir = os.path.dirname(os.path.abspath(__file__))
# Get version
sys.path.insert(0, os.path.join(this_dir, "imageio_ffmpeg"))
try:
from _definitions import __version__
finally:
sys.path.pop(0)
# Disallow releasin... | 31.154762 | 86 | 0.677111 |
import os
import sys
from setuptools import setup
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(this_dir, "imageio_ffmpeg"))
try:
from _definitions import __version__
finally:
sys.path.pop(0)
if "upload" in sys.argv:
raise RuntimeError("Running setup.py upload... | true | true |
1c2bb9375a496db093a5e79a34e5b401bf3621e7 | 1,514 | py | Python | sourcecode/src/vx/pgff/Access.py | Jarol0709/GFF | 2817ef97434c1e2c0c96cdbf48617d5a38c01e01 | [
"MIT"
] | 1 | 2021-01-23T14:22:03.000Z | 2021-01-23T14:22:03.000Z | sourcecode/src/vx/pgff/Access.py | Jarol0709/GFF | 2817ef97434c1e2c0c96cdbf48617d5a38c01e01 | [
"MIT"
] | null | null | null | sourcecode/src/vx/pgff/Access.py | Jarol0709/GFF | 2817ef97434c1e2c0c96cdbf48617d5a38c01e01 | [
"MIT"
] | 3 | 2021-02-22T17:30:19.000Z | 2021-08-03T03:19:29.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ivar Vargas Belizario
# Copyright (c) 2020
# E-mail: ivar@usp.br
import tornado.ioloop
import tornado.web
import tornado.httpserver
import ujson
import bcrypt
from vx.pgff.Settings import *
from vx.pgff.BaseHandler import *
from vx.pgff.User import *
from vx.... | 24.419355 | 76 | 0.548217 |
import tornado.ioloop
import tornado.web
import tornado.httpserver
import ujson
import bcrypt
from vx.pgff.Settings import *
from vx.pgff.BaseHandler import *
from vx.pgff.User import *
from vx.com.py.database.MongoDB import *
class Login(BaseHandler):
def get(self):
if Settings.MULIUSER==1:
... | true | true |
1c2bb941a4ed9df0e80487cc0c96e709d64f5ad3 | 4,579 | py | Python | generator/interact_server.py | AbrahamSanders/SIMIE | 5c3ed41307627c11df3ce2297f5f5369b4b01b79 | [
"MIT"
] | 5 | 2021-02-10T03:43:10.000Z | 2021-06-15T18:02:26.000Z | generator/interact_server.py | AbrahamSanders/SIMIE | 5c3ed41307627c11df3ce2297f5f5369b4b01b79 | [
"MIT"
] | 4 | 2021-02-13T21:58:00.000Z | 2021-05-04T01:23:26.000Z | generator/interact_server.py | AbrahamSanders/SIMIE | 5c3ed41307627c11df3ce2297f5f5369b4b01b79 | [
"MIT"
] | null | null | null | from transformers import AutoModelForCausalLM, AutoTokenizer
from flask import Flask, abort, send_from_directory
from flask_restful import Resource, Api, reqparse
import argparse
import uuid
import numpy as np
import torch
from interact import generate
from identities import Identities
parser = argparse.ArgumentParse... | 42.009174 | 155 | 0.694475 | from transformers import AutoModelForCausalLM, AutoTokenizer
from flask import Flask, abort, send_from_directory
from flask_restful import Resource, Api, reqparse
import argparse
import uuid
import numpy as np
import torch
from interact import generate
from identities import Identities
parser = argparse.ArgumentParse... | true | true |
1c2bb9cd9c55edaa99b3d19fa83399689105d278 | 5,661 | py | Python | pypy/objspace/std/callmethod.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/objspace/std/callmethod.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/objspace/std/callmethod.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | """
Two bytecodes to speed up method calls. Here is how a method call looks
like: (on the left, without the new bytecodes; on the right, with them)
<push self> <push self>
LOAD_ATTR name LOOKUP_METHOD name
<push arg 0> <push arg 0>
... ... | 39.3125 | 81 | 0.592122 |
from pypy.interpreter import function
from rpython.rlib import jit
from pypy.objspace.std.mapdict import LOOKUP_METHOD_mapdict, \
LOOKUP_METHOD_mapdict_fill_cache_method
def LOOKUP_METHOD(f, nameindex, *ignored):
from pypy.objspace.std.typeobject import MutableCell
... | true | true |
1c2bbc46fb79ba1730324fa391dfec2a9e71fecd | 540 | py | Python | manage.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | manage.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | 11 | 2019-11-12T23:26:45.000Z | 2021-06-10T17:37:23.000Z | manage.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "funcrowd.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "funcrowd.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's instal... | true | true |
1c2bbd9182ee7fdf9900b481d7b484a821b2ea31 | 10,016 | py | Python | app/main/routes.py | ktroach/cmp-1 | df3bc2d22532fe61173353b41709347f066a7ad5 | [
"MIT"
] | null | null | null | app/main/routes.py | ktroach/cmp-1 | df3bc2d22532fe61173353b41709347f066a7ad5 | [
"MIT"
] | null | null | null | app/main/routes.py | ktroach/cmp-1 | df3bc2d22532fe61173353b41709347f066a7ad5 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import render_template, flash, redirect, url_for, request, g, \
jsonify, current_app
from flask_login import current_user, login_required
from flask_babel import _, get_locale
from guess_language import guess_language
from app import db
from app.main.forms import EditProfile... | 39.125 | 95 | 0.660843 | from datetime import datetime
from flask import render_template, flash, redirect, url_for, request, g, \
jsonify, current_app
from flask_login import current_user, login_required
from flask_babel import _, get_locale
from guess_language import guess_language
from app import db
from app.main.forms import EditProfile... | true | true |
1c2bbfca17c2a5d7769a1f7e84a006cad6f8c519 | 9,393 | py | Python | dj_rql/drf/compat.py | maxipavlovic/django-rql | 53ece0cb44759310cc144193229bc0d9f16be831 | [
"Apache-2.0"
] | null | null | null | dj_rql/drf/compat.py | maxipavlovic/django-rql | 53ece0cb44759310cc144193229bc0d9f16be831 | [
"Apache-2.0"
] | null | null | null | dj_rql/drf/compat.py | maxipavlovic/django-rql | 53ece0cb44759310cc144193229bc0d9f16be831 | [
"Apache-2.0"
] | 1 | 2021-12-07T13:30:52.000Z | 2021-12-07T13:30:52.000Z | #
# Copyright © 2021 Ingram Micro Inc. All rights reserved.
#
from collections import Counter
from dj_rql.constants import (
ComparisonOperators as CO,
DjangoLookups as DJL,
FilterTypes,
RQL_ANY_SYMBOL,
RQL_FALSE,
RQL_LIMIT_PARAM,
RQL_NULL,
RQL_OFFSET_PARAM,
RQL_ORDERING_OPERATOR,... | 34.156364 | 99 | 0.6425 |
from collections import Counter
from dj_rql.constants import (
ComparisonOperators as CO,
DjangoLookups as DJL,
FilterTypes,
RQL_ANY_SYMBOL,
RQL_FALSE,
RQL_LIMIT_PARAM,
RQL_NULL,
RQL_OFFSET_PARAM,
RQL_ORDERING_OPERATOR,
RQL_TRUE,
SearchOperators as SO,
)
from dj_rql.drf.... | true | true |
1c2bbfcab211315e2f9579e4af1707db3698248f | 927 | py | Python | dinofw/utils/api.py | thenetcircle/dino-service | 90f90e0b21ba920506dc8fc44caf69d5bed9fb6a | [
"MIT"
] | null | null | null | dinofw/utils/api.py | thenetcircle/dino-service | 90f90e0b21ba920506dc8fc44caf69d5bed9fb6a | [
"MIT"
] | 4 | 2021-05-24T04:31:34.000Z | 2021-06-28T03:38:56.000Z | dinofw/utils/api.py | thenetcircle/dino-service | 90f90e0b21ba920506dc8fc44caf69d5bed9fb6a | [
"MIT"
] | null | null | null | import inspect
from fastapi import HTTPException
from fastapi import status
from loguru import logger
from dinofw.utils import environ
from dinofw.utils.config import ErrorCodes
# dependency
def get_db():
db = environ.env.SessionLocal()
try:
yield db
finally:
db.close()
def log_error_a... | 23.769231 | 60 | 0.710895 | import inspect
from fastapi import HTTPException
from fastapi import status
from loguru import logger
from dinofw.utils import environ
from dinofw.utils.config import ErrorCodes
def get_db():
db = environ.env.SessionLocal()
try:
yield db
finally:
db.close()
def log_error_and_raise_unk... | true | true |
1c2bc09f1d0f689171edfa743b927e6341b11021 | 15,580 | py | Python | uds/uds_config_tool/FunctionCreation/DiagnosticSessionControlMethodFactory.py | J3rome/python-uds | fe0f7a9505cb7b87f693ab736d713d7871dff288 | [
"MIT"
] | null | null | null | uds/uds_config_tool/FunctionCreation/DiagnosticSessionControlMethodFactory.py | J3rome/python-uds | fe0f7a9505cb7b87f693ab736d713d7871dff288 | [
"MIT"
] | null | null | null | uds/uds_config_tool/FunctionCreation/DiagnosticSessionControlMethodFactory.py | J3rome/python-uds | fe0f7a9505cb7b87f693ab736d713d7871dff288 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = "Richard Clubb"
__copyrights__ = "Copyright 2018, the python-uds project"
__credits__ = ["Richard Clubb"]
__license__ = "MIT"
__maintainer__ = "Richard Clubb"
__email__ = "richard.clubb@embeduk.com"
__status__ = "Development"
import xml.etree.ElementTree as ET
from .. import Decode... | 50.096463 | 202 | 0.525417 |
__author__ = "Richard Clubb"
__copyrights__ = "Copyright 2018, the python-uds project"
__credits__ = ["Richard Clubb"]
__license__ = "MIT"
__maintainer__ = "Richard Clubb"
__email__ = "richard.clubb@embeduk.com"
__status__ = "Development"
import xml.etree.ElementTree as ET
from .. import DecodeFunctions
import sys
... | true | true |
1c2bc12eec7806707ac9c57a5277267fb7cd156d | 12,142 | py | Python | Code/scripts/SimCLR/SimCLR_DSAD_scripts.py | antoine-spahr/X-ray-Anomaly-Detection | 850b6195d6290a50eee865b4d5a66f5db5260e8f | [
"MIT"
] | 2 | 2020-10-12T08:25:13.000Z | 2021-08-16T08:43:43.000Z | Code/scripts/SimCLR/SimCLR_DSAD_scripts.py | antoine-spahr/X-ray-Anomaly-Detection | 850b6195d6290a50eee865b4d5a66f5db5260e8f | [
"MIT"
] | null | null | null | Code/scripts/SimCLR/SimCLR_DSAD_scripts.py | antoine-spahr/X-ray-Anomaly-Detection | 850b6195d6290a50eee865b4d5a66f5db5260e8f | [
"MIT"
] | 1 | 2020-06-17T07:40:17.000Z | 2020-06-17T07:40:17.000Z | import torch
import torch.cuda
import logging
import numpy as np
import pandas as pd
import random
from datetime import datetime
import os
import sys
sys.path.append('../../')
import click
from src.datasets.MURADataset import MURA_TrainValidTestSplitter, MURA_Dataset, MURADataset_SimCLR
from src.models.SimCLR_DSAD imp... | 51.888889 | 132 | 0.580053 | import torch
import torch.cuda
import logging
import numpy as np
import pandas as pd
import random
from datetime import datetime
import os
import sys
sys.path.append('../../')
import click
from src.datasets.MURADataset import MURA_TrainValidTestSplitter, MURA_Dataset, MURADataset_SimCLR
from src.models.SimCLR_DSAD imp... | true | true |
1c2bc1508689c277c7d35f6f54288d95419839a0 | 8,586 | py | Python | examples/example_network_expressroutecircuits.py | zikalino/AzurePythonExamples | 23f9c173f0736f4e7ff66dde0402ef88da4ccc8f | [
"MIT"
] | 1 | 2020-09-04T14:38:13.000Z | 2020-09-04T14:38:13.000Z | examples/example_network_expressroutecircuits.py | zikalino/AzurePythonExamples | 23f9c173f0736f4e7ff66dde0402ef88da4ccc8f | [
"MIT"
] | null | null | null | examples/example_network_expressroutecircuits.py | zikalino/AzurePythonExamples | 23f9c173f0736f4e7ff66dde0402ef88da4ccc8f | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import os
f... | 44.95288 | 186 | 0.548684 |
import os
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.resource import ResourceManagementClient
from azure.common.credentials import ServicePrincipalCredentials
SUBSCRIPTION_ID = os.environ['AZURE_SUBSCRIPTION_ID']
TENANT_ID = os.environ['AZURE_TENANT']
CLIENT_ID = os.environ['AZURE... | true | true |
1c2bc1ce0f7b96e0e21029da273c24947ff3b10f | 655 | py | Python | Lecture/Kapitel 9 - Seite 230 - Einsatzbereit mit TensorFlow.py | PhilippMatthes/tensorflow-playground | b5fee6e5f5044dc5cbcd54529d559388a3df7813 | [
"MIT"
] | null | null | null | Lecture/Kapitel 9 - Seite 230 - Einsatzbereit mit TensorFlow.py | PhilippMatthes/tensorflow-playground | b5fee6e5f5044dc5cbcd54529d559388a3df7813 | [
"MIT"
] | null | null | null | Lecture/Kapitel 9 - Seite 230 - Einsatzbereit mit TensorFlow.py | PhilippMatthes/tensorflow-playground | b5fee6e5f5044dc5cbcd54529d559388a3df7813 | [
"MIT"
] | null | null | null | import tensorflow as tf
x = tf.Variable(3, name="x")
y = tf.Variable(4, name="y")
f = x * x * y + y + 2
with tf.Session() as sess:
x.initializer.run()
y.initializer.run()
result1 = f.eval()
init = tf.global_variables_initializer()
with tf.Session() as sess:
init.run()
result2 = f.eval()
print(re... | 17.236842 | 41 | 0.632061 | import tensorflow as tf
x = tf.Variable(3, name="x")
y = tf.Variable(4, name="y")
f = x * x * y + y + 2
with tf.Session() as sess:
x.initializer.run()
y.initializer.run()
result1 = f.eval()
init = tf.global_variables_initializer()
with tf.Session() as sess:
init.run()
result2 = f.eval()
print(re... | true | true |
1c2bc1e4c4d14eabfd6f1d197618b21ae3dcb4be | 1,823 | py | Python | software/patterns/texture.py | mayhem/led-chandelier | 899caa8d81e6aac6e954f78b4f5b4ab101bf5257 | [
"MIT"
] | 2 | 2018-09-20T08:36:11.000Z | 2019-08-25T20:06:11.000Z | software/patterns/texture.py | mayhem/led-chandelier | 899caa8d81e6aac6e954f78b4f5b4ab101bf5257 | [
"MIT"
] | null | null | null | software/patterns/texture.py | mayhem/led-chandelier | 899caa8d81e6aac6e954f78b4f5b4ab101bf5257 | [
"MIT"
] | 1 | 2020-12-12T18:21:18.000Z | 2020-12-12T18:21:18.000Z | #!/usr/bin/env python3
import os
import sys
import math
from colorsys import hsv_to_rgb
from hippietrap.hippietrap import HippieTrap, ALL, NUM_NODES
from hippietrap.pattern import PatternBase, run_pattern
from time import sleep, time
from random import random
from hippietrap.geometry import HippieTrapGeometry
from hip... | 26.808824 | 78 | 0.560614 |
import os
import sys
import math
from colorsys import hsv_to_rgb
from hippietrap.hippietrap import HippieTrap, ALL, NUM_NODES
from hippietrap.pattern import PatternBase, run_pattern
from time import sleep, time
from random import random
from hippietrap.geometry import HippieTrapGeometry
from hippietrap.color import C... | true | true |
1c2bc29b7f66439e368f4f8ee380cb0e9f1b345d | 92,659 | py | Python | python/ccxt/async_support/wavesexchange.py | StatyMcStats/ccxt | a464ecb0c9aba1945a7ef6e558939cce8ce6c47e | [
"MIT"
] | null | null | null | python/ccxt/async_support/wavesexchange.py | StatyMcStats/ccxt | a464ecb0c9aba1945a7ef6e558939cce8ce6c47e | [
"MIT"
] | null | null | null | python/ccxt/async_support/wavesexchange.py | StatyMcStats/ccxt | a464ecb0c9aba1945a7ef6e558939cce8ce6c47e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import A... | 44.892926 | 1,000 | 0.516161 |
rt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccx... | true | true |
1c2bc3a25d7069e9289c2b367bcecdf522ac1c1a | 3,427 | py | Python | huaweicloud-sdk-dcs/huaweicloudsdkdcs/v2/model/update_password_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-dcs/huaweicloudsdkdcs/v2/model/update_password_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-dcs/huaweicloudsdkdcs/v2/model/update_password_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class UpdatePasswordRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the va... | 25.385185 | 74 | 0.553254 |
import pprint
import re
import six
class UpdatePasswordRequest:
sensitive_list = []
openapi_types = {
'instance_id': 'str',
'body': 'ModifyInstancePasswordBody'
}
attribute_map = {
'instance_id': 'instance_id',
'body': 'body'
}
def __init__(self, ins... | true | true |
1c2bc44d4ae2e40e2df2e5a7fd7b06e1b26b0809 | 1,693 | py | Python | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/constants/__init__.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/constants/__init__.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/constants/__init__.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains astronomical and physical constants for use in Astropy or other
places.
A typical use case might be::
>>> from astropy.constants import c, m_e
>>> # ... define the mass of something you want the rest energy of as m ...
>>> m = m_... | 30.232143 | 79 | 0.550502 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import itertools
try:
from .. import units
del units
except ImportError:
pass
from .constant import Constant, EMConstant
from . import si
from . import cgs
_lines = [
'The following consta... | true | true |
1c2bc56c431a8930996709b573d3ff160e8b2b3d | 738 | py | Python | ros_sandbox/catkin_ws/src/beginner/scripts/listener.py | kjgonzalez/codefiles | b86f25182d1b5553a331f8721dd06b51fa157c3e | [
"MIT"
] | null | null | null | ros_sandbox/catkin_ws/src/beginner/scripts/listener.py | kjgonzalez/codefiles | b86f25182d1b5553a331f8721dd06b51fa157c3e | [
"MIT"
] | 10 | 2019-10-01T20:48:15.000Z | 2020-04-14T18:21:09.000Z | ros_sandbox/catkin_ws/src/beginner/scripts/listener.py | kjgonzalez/codefiles | b86f25182d1b5553a331f8721dd06b51fa157c3e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
see talker.py for more information
'''
import rospy
from std_msgs.msg import String
def callback(data):
rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
def listener():
# In ROS, nodes are uniquely named. If two nodes with the same
# name are launched, the pre... | 26.357143 | 72 | 0.699187 |
import rospy
from std_msgs.msg import String
def callback(data):
rospy.loginfo(rospy.get_caller_id() + "I heard %s", data.data)
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("chatter", String, callback)
rospy.spin()
if __name__ == ... | true | true |
1c2bc5a344893c7237a4fdc6553393d6f0ff80f8 | 4,724 | py | Python | datasets/kor_hate/kor_hate.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 10,608 | 2020-09-10T15:47:50.000Z | 2022-03-31T22:51:47.000Z | datasets/kor_hate/kor_hate.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 2,396 | 2020-09-10T14:55:31.000Z | 2022-03-31T19:41:04.000Z | datasets/kor_hate/kor_hate.py | realChainLife/datasets | 98261e8b0b7be4dbaaa71ae188b950f7fbe51bbd | [
"Apache-2.0"
] | 1,530 | 2020-09-10T21:43:10.000Z | 2022-03-31T01:59:12.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 48.204082 | 1,117 | 0.703006 |
import csv
import datasets
_CITATION = """\
@inproceedings{moon-etal-2020-beep,
title = "{BEEP}! {K}orean Corpus of Online News Comments for Toxic Speech Detection",
author = "Moon, Jihyung and
Cho, Won Ik and
Lee, Junbum",
booktitle = "Proceedings of the Eighth Internationa... | true | true |
1c2bc5c356dac5e51b277bd6d832c1e32cf63e8b | 4,300 | py | Python | test/cut/test_cut_merge_supervisions.py | rosrad/lhotse | 177ce3a6b963d4ac56a87843a0130ccfc74b3a57 | [
"Apache-2.0"
] | 353 | 2020-10-31T10:38:51.000Z | 2022-03-30T05:22:52.000Z | test/cut/test_cut_merge_supervisions.py | rosrad/lhotse | 177ce3a6b963d4ac56a87843a0130ccfc74b3a57 | [
"Apache-2.0"
] | 353 | 2020-10-27T23:25:12.000Z | 2022-03-31T22:16:05.000Z | test/cut/test_cut_merge_supervisions.py | rosrad/lhotse | 177ce3a6b963d4ac56a87843a0130ccfc74b3a57 | [
"Apache-2.0"
] | 66 | 2020-11-01T06:08:08.000Z | 2022-03-29T02:03:07.000Z | from lhotse import CutSet
from lhotse.cut import PaddingCut
from lhotse.testing.dummies import DummyManifest, dummy_cut, dummy_supervision
def test_mono_cut_merge_supervisions():
cut = dummy_cut(
0,
duration=10,
supervisions=[
dummy_supervision(0, start=1, duration=2),
... | 33.59375 | 84 | 0.68907 | from lhotse import CutSet
from lhotse.cut import PaddingCut
from lhotse.testing.dummies import DummyManifest, dummy_cut, dummy_supervision
def test_mono_cut_merge_supervisions():
cut = dummy_cut(
0,
duration=10,
supervisions=[
dummy_supervision(0, start=1, duration=2),
... | true | true |
1c2bc6587696105dda1accbc0708f3301279c001 | 27,780 | py | Python | javsdt/JavbusYouma.py | wineast/javsdt | 5cdcee19e7c1bfade46f8e5a933693c68bcceb63 | [
"MIT"
] | 7 | 2021-06-09T07:16:17.000Z | 2022-03-01T05:32:20.000Z | javsdt/JavbusYouma.py | wineast/javsdt | 5cdcee19e7c1bfade46f8e5a933693c68bcceb63 | [
"MIT"
] | null | null | null | javsdt/JavbusYouma.py | wineast/javsdt | 5cdcee19e7c1bfade46f8e5a933693c68bcceb63 | [
"MIT"
] | 1 | 2021-06-05T10:10:22.000Z | 2021-06-05T10:10:22.000Z | # -*- coding:utf-8 -*-
import os, re
from shutil import copyfile
from traceback import format_exc
########################################################################################################################
from Class.Settings import Settings
from Class.JavFile import JavFile
from Functions.Status import ju... | 47.568493 | 206 | 0.487869 |
import os, re
from shutil import copyfile
from traceback import format_exc
pan> <a href=".+?">(.+?)<', html_web)
if str(directorg) != 'None':
dict_data['导演'] = replace_xml_win(directorg.group(1))
else:
dict_data['导演'] = '有码导演'
# 片商... | true | true |
1c2bc749f187c7eed4b2e52f2d167111094537a8 | 32,080 | py | Python | test/nn/test_multiple_module_flipsrotations.py | QUVA-Lab/escnn | 59ed6b96f61f8616f87b3f25aa2f8abdb6f1a882 | [
"BSD-3-Clause"
] | 4 | 2022-03-16T22:51:39.000Z | 2022-03-18T18:45:49.000Z | test/nn/test_multiple_module_flipsrotations.py | QUVA-Lab/escnn | 59ed6b96f61f8616f87b3f25aa2f8abdb6f1a882 | [
"BSD-3-Clause"
] | null | null | null | test/nn/test_multiple_module_flipsrotations.py | QUVA-Lab/escnn | 59ed6b96f61f8616f87b3f25aa2f8abdb6f1a882 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from unittest import TestCase
from escnn.nn import *
from escnn.gspaces import *
import torch
import random
batchnormalizations = [
([('regular_bnorm', 'pointwise')], InnerBatchNorm),
([('g_bnorm', 'norm')], GNormBatchNorm),
([('norm_bnorm', 'norm')], NormBatchNorm),
([('indnorm_bnor... | 32.970195 | 95 | 0.470854 | import unittest
from unittest import TestCase
from escnn.nn import *
from escnn.gspaces import *
import torch
import random
batchnormalizations = [
([('regular_bnorm', 'pointwise')], InnerBatchNorm),
([('g_bnorm', 'norm')], GNormBatchNorm),
([('norm_bnorm', 'norm')], NormBatchNorm),
([('indnorm_bnor... | true | true |
1c2bc7eb173349f47a557a2b19dac248efb80629 | 10,472 | py | Python | zs3/tools.py | vaynelau/zs3-modified | da48567cb30e60dbe7827f56ec48f1a0098cd94a | [
"Apache-2.0"
] | null | null | null | zs3/tools.py | vaynelau/zs3-modified | da48567cb30e60dbe7827f56ec48f1a0098cd94a | [
"Apache-2.0"
] | null | null | null | zs3/tools.py | vaynelau/zs3-modified | da48567cb30e60dbe7827f56ec48f1a0098cd94a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import yaml
import random
import pickle
import cv2
import numpy as np
import torch
import torch.nn.functional as F
class MeaninglessError(BaseException):
pass
class Const_Scheduler():
def __init__(self, step_n='step1'):
assert (step_n in ['step1', 'step2', 'self_training'])
... | 38.929368 | 150 | 0.612777 | import os
import sys
import yaml
import random
import pickle
import cv2
import numpy as np
import torch
import torch.nn.functional as F
class MeaninglessError(BaseException):
pass
class Const_Scheduler():
def __init__(self, step_n='step1'):
assert (step_n in ['step1', 'step2', 'self_training'])
... | true | true |
1c2bc8edf67c70d66eaf4332f8ec9bfdbb7cfc35 | 2,023 | py | Python | gui/mlin.py | pocar/mlin | d7d37a9f20a22a94a23b31a8b281c6c10dda178e | [
"MIT"
] | null | null | null | gui/mlin.py | pocar/mlin | d7d37a9f20a22a94a23b31a8b281c6c10dda178e | [
"MIT"
] | null | null | null | gui/mlin.py | pocar/mlin | d7d37a9f20a22a94a23b31a8b281c6c10dda178e | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Created on 5. avg. 2012
@author: anton
'''
import pygame
from pygame.locals import *
from igralnadeska import IgralnaDeska
from gradniki import *
velikostZaslona = [640, 480]
bela = (255, 255, 255)
crna = (0, 0, 0 )
svetlo_siva = (230, 230, 230)
temno_siva = (80, 80, 80)
def main():
... | 29.75 | 95 | 0.605042 |
import pygame
from pygame.locals import *
from igralnadeska import IgralnaDeska
from gradniki import *
velikostZaslona = [640, 480]
bela = (255, 255, 255)
crna = (0, 0, 0 )
svetlo_siva = (230, 230, 230)
temno_siva = (80, 80, 80)
def main():
pygame.init()
deska = IgralnaDeska(Rect((0,0),(veliko... | true | true |
1c2bc9966a7a60e8e1fd981ceb1dafd7a6ab7d6e | 1,927 | py | Python | tools/mytools/ARIA/src/py/aria/FloatFile.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/FloatFile.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/FloatFile.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | """
ARIA -- Ambiguous Restraints for Iterative Assignment
A software for automated NOE assignment
Version 2.3
Copyright (C) Benjamin Bardiaux, Michael Habeck, Therese Malliavin,
Wolfgang Rieping, and Michael Nilges
All rights reserved.
NO W... | 26.763889 | 77 | 0.567722 |
from aria.ariabase import AriaBaseClass as _AriaBaseClass
class FloatFile(_AriaBaseClass):
def parse(self, file):
from aria.tools import string_to_segid
import re
atom = 'segid "(?P<segid%(i)d>.*)" and ' + \
'resid (?P<residue%(i)d>[0-9]+).*and ' + \
'nam... | true | true |
1c2bca30ebc3205d10e58a5c3f4df4a6a073fa28 | 41,448 | py | Python | tests/test_tuya.py | Thomas55555/zha-device-handlers | 16c76d85dbb7bb71ae38cf37a46e9665e25a5fcc | [
"Apache-2.0"
] | null | null | null | tests/test_tuya.py | Thomas55555/zha-device-handlers | 16c76d85dbb7bb71ae38cf37a46e9665e25a5fcc | [
"Apache-2.0"
] | null | null | null | tests/test_tuya.py | Thomas55555/zha-device-handlers | 16c76d85dbb7bb71ae38cf37a46e9665e25a5fcc | [
"Apache-2.0"
] | null | null | null | """Tests for Tuya quirks."""
import asyncio
import datetime
from unittest import mock
import pytest
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice, get_device
import zigpy.types as t
from zigpy.zcl import foundation
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTER... | 38.377778 | 140 | 0.6692 |
import asyncio
import datetime
from unittest import mock
import pytest
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice, get_device
import zigpy.types as t
from zigpy.zcl import foundation
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OFF,
... | true | true |
1c2bcb1045a9bfdca3102dc09f5c3dfe9e119723 | 350 | py | Python | music_site/artists/migrations/0002_auto_20200531_2240.py | UVG-Teams/music-space | 8f464b6b1cbe59afea3be3ab1b9ed4e25ab0b424 | [
"MIT"
] | null | null | null | music_site/artists/migrations/0002_auto_20200531_2240.py | UVG-Teams/music-space | 8f464b6b1cbe59afea3be3ab1b9ed4e25ab0b424 | [
"MIT"
] | null | null | null | music_site/artists/migrations/0002_auto_20200531_2240.py | UVG-Teams/music-space | 8f464b6b1cbe59afea3be3ab1b9ed4e25ab0b424 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-05-31 22:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('artists', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='artist',
old_name='artistid',
ne... | 18.421053 | 47 | 0.568571 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('artists', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='artist',
old_name='artistid',
new_name='id',
),
]
| true | true |
1c2bcb9944cc662cdfce1818d2d5730b669f6727 | 241 | py | Python | 2020/Day3/day3.py | dh256/adventofcode | 428eec13f4cbf153333a0e359bcff23070ef6d27 | [
"MIT"
] | null | null | null | 2020/Day3/day3.py | dh256/adventofcode | 428eec13f4cbf153333a0e359bcff23070ef6d27 | [
"MIT"
] | null | null | null | 2020/Day3/day3.py | dh256/adventofcode | 428eec13f4cbf153333a0e359bcff23070ef6d27 | [
"MIT"
] | null | null | null | from Map import Map,Slope
map = Map("input.txt")
# Part 1
slopes = [Slope(3,1)]
trees = map.traverse(slopes)
print(trees)
# Part 2
slopes = [Slope(3,1),Slope(1,1),Slope(5,1),Slope(7,1),Slope(1,2)]
trees = map.traverse(slopes)
print(trees) | 18.538462 | 65 | 0.676349 | from Map import Map,Slope
map = Map("input.txt")
slopes = [Slope(3,1)]
trees = map.traverse(slopes)
print(trees)
slopes = [Slope(3,1),Slope(1,1),Slope(5,1),Slope(7,1),Slope(1,2)]
trees = map.traverse(slopes)
print(trees) | true | true |
1c2bcc15f683de53f888261008c1e63ae818dbf9 | 10,555 | py | Python | src/ggrc/migrations/versions/20161220161315_275cd0dcaea_migrate_assessments_issues_data.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | src/ggrc/migrations/versions/20161220161315_275cd0dcaea_migrate_assessments_issues_data.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/migrations/versions/20161220161315_275cd0dcaea_migrate_assessments_issues_data.py | zidarsk8/ggrc-core | 2509c989eddf434249d3bef50c21e08dbf56c1a4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
migrate-assessments-issues-data
Create Date: 2016-12-20 16:13:15.208946
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from collectio... | 32.179878 | 79 | 0.645381 |
from collections import defaultdict
from logging import getLogger
from alembic import op
from sqlalchemy.sql import column
from sqlalchemy.sql import select
from sqlalchemy.sql import table
from sqlalchemy.sql import tuple_
from ggrc.models.assessment import Assessment
from ggrc.models.event import Event
from ... | true | true |
1c2bcd1e3e93e7023f4d922645a64432b5bafb74 | 2,544 | py | Python | juriscraper/opinions/united_states_backscrapers/federal_special/cit_2012.py | umeboshi2/juriscraper | 16abceb3747947593841b1c2708de84dcc85c59d | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_special/cit_2012.py | umeboshi2/juriscraper | 16abceb3747947593841b1c2708de84dcc85c59d | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_special/cit_2012.py | umeboshi2/juriscraper | 16abceb3747947593841b1c2708de84dcc85c59d | [
"BSD-2-Clause"
] | 1 | 2021-03-03T00:03:16.000Z | 2021-03-03T00:03:16.000Z | from juriscraper.opinions.united_states.federal_special import cit
import time
from datetime import date
from lxml import html
class Site(cit.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://www.cit.uscourts.gov/SlipOpinions/SlipOps-2012.htm... | 41.704918 | 164 | 0.575865 | from juriscraper.opinions.united_states.federal_special import cit
import time
from datetime import date
from lxml import html
class Site(cit.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.url = 'http://www.cit.uscourts.gov/SlipOpinions/SlipOps-2012.htm... | true | true |
1c2bcd99377144a70c6b4cf337e8494afb4b82be | 1,898 | py | Python | observations/r/sitka89.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | observations/r/sitka89.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | observations/r/sitka89.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def sitka89(path):
"""Growth Curves for Sitka Spruce Trees in 1989
The... | 27.507246 | 74 | 0.685458 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def sitka89(path):
import pandas as pd
path = os.path.expanduser(path)
filename = 'sitka89.c... | true | true |
1c2bcda870c9e08e95030504c70d667134630c0e | 4,776 | py | Python | Elastic/searchIndex.py | tohardik/falcon2.0 | 76453360b9735b94a639fc98698900b2591bca9d | [
"MIT"
] | null | null | null | Elastic/searchIndex.py | tohardik/falcon2.0 | 76453360b9735b94a639fc98698900b2591bca9d | [
"MIT"
] | null | null | null | Elastic/searchIndex.py | tohardik/falcon2.0 | 76453360b9735b94a639fc98698900b2591bca9d | [
"MIT"
] | null | null | null | from elasticsearch import Elasticsearch
import editdistance
es = Elasticsearch(hosts=['http://geo-qa.cs.upb.de:9200/'])
entity_index_name = "geoqa-entity"
relation_index_name = "geoqa-relation"
def entitySearch(query):
results = []
###################################################
elasticResults = es.s... | 38.829268 | 110 | 0.479062 | from elasticsearch import Elasticsearch
import editdistance
es = Elasticsearch(hosts=['http://geo-qa.cs.upb.de:9200/'])
entity_index_name = "geoqa-entity"
relation_index_name = "geoqa-relation"
def entitySearch(query):
results = []
| true | true |
1c2bcdd474b8c2c081e8e5279f62cbb67e898626 | 2,430 | py | Python | megfile/utils/mutex.py | yujianpeng66/megfile | 6586c76abb45e07aef1e42ed0d78e7490d08df67 | [
"Apache-2.0",
"MIT"
] | 69 | 2021-08-28T15:03:26.000Z | 2022-03-04T23:43:22.000Z | megfile/utils/mutex.py | yujianpeng66/megfile | 6586c76abb45e07aef1e42ed0d78e7490d08df67 | [
"Apache-2.0",
"MIT"
] | 75 | 2021-08-30T02:36:46.000Z | 2022-03-29T07:59:11.000Z | megfile/utils/mutex.py | yujianpeng66/megfile | 6586c76abb45e07aef1e42ed0d78e7490d08df67 | [
"Apache-2.0",
"MIT"
] | 9 | 2021-08-30T10:46:52.000Z | 2022-01-08T08:26:58.000Z | import os
from abc import ABC, abstractmethod
from functools import wraps
from threading import RLock
from threading import local as _ThreadLocal
from typing import Any, Callable, Iterator
__all__ = [
'ThreadLocal',
'ProcessLocal',
]
class ForkAware(ABC):
def __init__(self):
self._process_id = o... | 22.71028 | 119 | 0.608642 | import os
from abc import ABC, abstractmethod
from functools import wraps
from threading import RLock
from threading import local as _ThreadLocal
from typing import Any, Callable, Iterator
__all__ = [
'ThreadLocal',
'ProcessLocal',
]
class ForkAware(ABC):
def __init__(self):
self._process_id = o... | true | true |
1c2bce00fcf67e341b874d95f2ab2bf80fdc16b1 | 66,979 | py | Python | django_evolution/mutations.py | beanbaginc/django-evolution | fb76e44a2361a69a440dca086c0cc67ac6a4300d | [
"BSD-3-Clause"
] | 18 | 2015-02-08T14:48:02.000Z | 2021-08-03T21:07:37.000Z | django_evolution/mutations.py | beanbaginc/django-evolution | fb76e44a2361a69a440dca086c0cc67ac6a4300d | [
"BSD-3-Clause"
] | 4 | 2015-01-07T01:15:08.000Z | 2020-08-06T06:52:13.000Z | django_evolution/mutations.py | beanbaginc/django-evolution | fb76e44a2361a69a440dca086c0cc67ac6a4300d | [
"BSD-3-Clause"
] | 13 | 2015-01-07T01:06:21.000Z | 2022-02-20T16:27:41.000Z | """Support for schema mutation operations and hint output."""
from __future__ import unicode_literals
import inspect
from functools import partial
from django.db import models
from django.db.utils import DEFAULT_DB_ALIAS
from django_evolution.compat import six
from django_evolution.compat.datastructures import Orde... | 34.939489 | 79 | 0.592828 |
from __future__ import unicode_literals
import inspect
from functools import partial
from django.db import models
from django.db.utils import DEFAULT_DB_ALIAS
from django_evolution.compat import six
from django_evolution.compat.datastructures import OrderedDict
from django_evolution.consts import UpgradeMethod
from... | true | true |
1c2bceacda0de761c082d958508ce542e943c8d5 | 9,011 | py | Python | torchvision/models/detection/backbone_utils.py | Oxygen-Chen/vision | b37c8a3ca4c9c626cdac763c6be697231665b0f8 | [
"BSD-3-Clause"
] | 1 | 2021-10-23T01:14:27.000Z | 2021-10-23T01:14:27.000Z | torchvision/models/detection/backbone_utils.py | Oxygen-Chen/vision | b37c8a3ca4c9c626cdac763c6be697231665b0f8 | [
"BSD-3-Clause"
] | null | null | null | torchvision/models/detection/backbone_utils.py | Oxygen-Chen/vision | b37c8a3ca4c9c626cdac763c6be697231665b0f8 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from typing import Callable, Dict, Optional, List, Union
from torch import nn, Tensor
from torchvision.ops import misc as misc_nn_ops
from torchvision.ops.feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool, ExtraFPNBlock
from .. import mobilenet
from .. import resnet
from .._utils ... | 42.305164 | 118 | 0.678948 | import warnings
from typing import Callable, Dict, Optional, List, Union
from torch import nn, Tensor
from torchvision.ops import misc as misc_nn_ops
from torchvision.ops.feature_pyramid_network import FeaturePyramidNetwork, LastLevelMaxPool, ExtraFPNBlock
from .. import mobilenet
from .. import resnet
from .._utils ... | true | true |
1c2bcfe9bb399413031680f32f453d69c06781b7 | 8,336 | py | Python | doclabel/core/migrations/0001_initial.py | sondh0127/doclabel | 2cadea9fc925435aea49ac0b56c29474664ade4e | [
"MIT"
] | null | null | null | doclabel/core/migrations/0001_initial.py | sondh0127/doclabel | 2cadea9fc925435aea49ac0b56c29474664ade4e | [
"MIT"
] | null | null | null | doclabel/core/migrations/0001_initial.py | sondh0127/doclabel | 2cadea9fc925435aea49ac0b56c29474664ade4e | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-24 13:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('cont... | 55.205298 | 408 | 0.568738 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_name'),
... | true | true |
1c2bd07b68bc5cdf7a5a5d3c69cee0798eb78adc | 2,806 | py | Python | torstack/core/rest.py | longniao/torstack | 148139eeca0f3cd8a8c2196ae2a6f8cea519d9b5 | [
"MIT"
] | 7 | 2018-12-11T03:41:04.000Z | 2018-12-11T06:08:45.000Z | torstack/core/rest.py | longniao/torstack | 148139eeca0f3cd8a8c2196ae2a6f8cea519d9b5 | [
"MIT"
] | null | null | null | torstack/core/rest.py | longniao/torstack | 148139eeca0f3cd8a8c2196ae2a6f8cea519d9b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
torstack.core.session
Basic token definition.
:copyright: (c) 2018 by longniao <longniao@gmail.com>
:license: MIT, see LICENSE for more details.
'''
from torstack.core.session import CoreSession
class CoreRest(object):
REST_CONFIG = dict()
HEADER_CONFIG = dict()
RESPONSE_CON... | 24.831858 | 79 | 0.557377 |
from torstack.core.session import CoreSession
class CoreRest(object):
REST_CONFIG = dict()
HEADER_CONFIG = dict()
RESPONSE_CONFIG = dict()
def __init__(self, driver, config={}):
self.__init_config(config)
self.__init_driver(driver)
def __init_config(self, config={}):
r... | true | true |
1c2bd15b25f8553f85262487587573b094708e24 | 4,723 | py | Python | lib/molecule/shell.py | santiagoroman/molecule | 4565cce0ea1f9b1e2dc3fb2aa668715ae466d534 | [
"MIT"
] | null | null | null | lib/molecule/shell.py | santiagoroman/molecule | 4565cce0ea1f9b1e2dc3fb2aa668715ae466d534 | [
"MIT"
] | null | null | null | lib/molecule/shell.py | santiagoroman/molecule | 4565cce0ea1f9b1e2dc3fb2aa668715ae466d534 | [
"MIT"
] | null | null | null | # Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# 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... | 35.780303 | 186 | 0.735973 |
import sys
from functools import lru_cache
import click
import click_completion
import pkg_resources
from click_help_colors import _colorize
import molecule
from molecule import command
from molecule.api import drivers
from molecule.command.base import click_group_ex
from molecule.config import MO... | true | true |
1c2bd46572caa123338ba23666700dee981f07f2 | 3,714 | py | Python | tools/updateRouting/lib/mrt.py | shutingrz/prefix2as | d8f7664df43b772c00323da69f280f493ad5495d | [
"MIT"
] | 9 | 2018-05-15T08:28:15.000Z | 2019-05-03T05:39:04.000Z | tools/updateRouting/lib/mrt.py | shutingrz/prefix2as | d8f7664df43b772c00323da69f280f493ad5495d | [
"MIT"
] | null | null | null | tools/updateRouting/lib/mrt.py | shutingrz/prefix2as | d8f7664df43b772c00323da69f280f493ad5495d | [
"MIT"
] | null | null | null | import os, sys, subprocess, ipaddress, re
from logging import getLogger
logger = getLogger(__name__)
class MRTController():
def __init__(self, mrtpath=None, peer_as=None):
self.mrt = []
self.bgpdump_path = "bgpdump"
if mrtpath is not None:
self.read(mrtpath)
def setBgpdumpPath(self, bgpdump_path):
self... | 26.15493 | 125 | 0.639742 | import os, sys, subprocess, ipaddress, re
from logging import getLogger
logger = getLogger(__name__)
class MRTController():
def __init__(self, mrtpath=None, peer_as=None):
self.mrt = []
self.bgpdump_path = "bgpdump"
if mrtpath is not None:
self.read(mrtpath)
def setBgpdumpPath(self, bgpdump_path):
self... | true | true |
1c2bd4f33e0efe0ea487527f49586d9323f6f851 | 3,455 | py | Python | purity_fb/purity_fb_1dot7/models/bucket_post.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot7/models/bucket_post.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot7/models/bucket_post.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.7 Python SDK
Pure Storage FlashBlade REST 1.7 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.7
Contact: i... | 28.089431 | 204 | 0.571925 |
import pprint
import re
import six
class BucketPost(object):
__test__ = False
swagger_types = {
'account': 'Reference'
}
attribute_map = {
'account': 'account'
}
def __init__(self, account=None):
self._account = None
self.discriminator = Non... | true | true |
1c2bd4fb69d5564412d0b4935bf6d627151c3049 | 1,718 | py | Python | lingcod/common/registration_backend/__init__.py | google-code-export/marinemap | b7d58db11720637845b6a83bf70435c32c5af531 | [
"BSD-3-Clause"
] | 3 | 2017-06-09T20:44:58.000Z | 2017-12-26T12:09:21.000Z | lingcod/common/registration_backend/__init__.py | underbluewaters/marinemap | c001e16615caa2178c65ca0684e1b6fd56d3f93d | [
"BSD-3-Clause"
] | null | null | null | lingcod/common/registration_backend/__init__.py | underbluewaters/marinemap | c001e16615caa2178c65ca0684e1b6fd56d3f93d | [
"BSD-3-Clause"
] | 3 | 2016-11-30T13:41:56.000Z | 2019-05-07T17:07:12.000Z | from registration.backends.default import DefaultBackend
from django.db import transaction
from django import forms
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User, Group
from registration.models import RegistrationManager, RegistrationProfile
from registration.form... | 39.953488 | 108 | 0.721187 | from registration.backends.default import DefaultBackend
from django.db import transaction
from django import forms
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User, Group
from registration.models import RegistrationManager, RegistrationProfile
from registration.form... | true | true |
1c2bd688676a727f79ca1b2423a2e52aadbb4b4e | 6,541 | py | Python | examples/03_connectivity/plot_atlas_comparison.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | null | null | null | examples/03_connectivity/plot_atlas_comparison.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | null | null | null | examples/03_connectivity/plot_atlas_comparison.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | null | null | null | """
Comparing connectomes on different reference atlases
====================================================
This examples shows how to turn a parcellation into connectome for
visualization. This requires choosing centers for each parcel
or network, via :func:`nilearn.plotting.find_parcellation_cut_coords` for
parcel... | 42.474026 | 88 | 0.64455 | true | true | |
1c2bd6aed7ee20af3634bd12110ddb6da35b153d | 15,241 | py | Python | eccpy/compare_raw.py | ricardo-ayres/eccpy | 39aaf51d1d18bbbc7c25ab3632f67ddbbbbd4fd5 | [
"MIT"
] | 28 | 2016-09-22T22:46:39.000Z | 2022-02-17T02:49:56.000Z | eccpy/compare_raw.py | ricardo-ayres/eccpy | 39aaf51d1d18bbbc7c25ab3632f67ddbbbbd4fd5 | [
"MIT"
] | 12 | 2016-08-02T13:36:03.000Z | 2022-01-27T13:37:15.000Z | eccpy/compare_raw.py | ricardo-ayres/eccpy | 39aaf51d1d18bbbc7c25ab3632f67ddbbbbd4fd5 | [
"MIT"
] | 10 | 2018-11-21T13:39:11.000Z | 2022-03-02T17:34:42.000Z | import ast
import eccpy.settings as eccpysettings
import eccpy.tools as tools
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import sys
def compare_rawdata(settings_excel_file, sample_names, **kwargs):
""" Compare raw dose-response curves between selected samples, for selected exp... | 65.412017 | 123 | 0.558822 | import ast
import eccpy.settings as eccpysettings
import eccpy.tools as tools
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import sys
def compare_rawdata(settings_excel_file, sample_names, **kwargs):
print("\nStarting compare_rawdata program")
if "list_output_fig_names... | true | true |
1c2bd72336ca0ee7b873ea60f30072b4d4e88e4d | 693 | py | Python | migrations/0001_initial.py | nibir404/Crud-app | d04293bb406fdb2727c3e836ab7b0aaad71c5987 | [
"MIT"
] | null | null | null | migrations/0001_initial.py | nibir404/Crud-app | d04293bb406fdb2727c3e836ab7b0aaad71c5987 | [
"MIT"
] | null | null | null | migrations/0001_initial.py | nibir404/Crud-app | d04293bb406fdb2727c3e836ab7b0aaad71c5987 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-08 12:00
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Insert',
fields=[
('id', mo... | 27.72 | 115 | 0.545455 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Insert',
fields=[
('id', models.AutoField(auto_created=True, primary_key=Tr... | true | true |
1c2bd7b146cb9086241020de734ef956e2f04b40 | 955 | py | Python | django_migration_linter/sql_analyser/analyser.py | vald-phoenix/django-migration-linter | 41a5dc731bf609a6530a15fa34788e2997655cbb | [
"Apache-2.0"
] | null | null | null | django_migration_linter/sql_analyser/analyser.py | vald-phoenix/django-migration-linter | 41a5dc731bf609a6530a15fa34788e2997655cbb | [
"Apache-2.0"
] | null | null | null | django_migration_linter/sql_analyser/analyser.py | vald-phoenix/django-migration-linter | 41a5dc731bf609a6530a15fa34788e2997655cbb | [
"Apache-2.0"
] | null | null | null | import logging
from django_migration_linter.sql_analyser import (
BaseAnalyser,
MySqlAnalyser,
PostgresqlAnalyser,
SqliteAnalyser,
)
logger = logging.getLogger(__name__)
def get_sql_analyser(database_vendor, exclude_migration_tests=None):
if "mysql" in database_vendor:
sql_analyser_class... | 28.939394 | 77 | 0.774869 | import logging
from django_migration_linter.sql_analyser import (
BaseAnalyser,
MySqlAnalyser,
PostgresqlAnalyser,
SqliteAnalyser,
)
logger = logging.getLogger(__name__)
def get_sql_analyser(database_vendor, exclude_migration_tests=None):
if "mysql" in database_vendor:
sql_analyser_class... | true | true |
1c2bd86baed6a9455e4f0050f9720b8b96eb9e27 | 3,683 | py | Python | flask_uwsgi_websocket/websocket.py | fredounnet/flask-uwsgi-websocket | 5d4a12ec3738cedbdb9e89ea34636de85f83a31e | [
"MIT"
] | null | null | null | flask_uwsgi_websocket/websocket.py | fredounnet/flask-uwsgi-websocket | 5d4a12ec3738cedbdb9e89ea34636de85f83a31e | [
"MIT"
] | null | null | null | flask_uwsgi_websocket/websocket.py | fredounnet/flask-uwsgi-websocket | 5d4a12ec3738cedbdb9e89ea34636de85f83a31e | [
"MIT"
] | null | null | null | import os
import sys
import uuid
from ._uwsgi import uwsgi
from gevent.monkey import patch_all
import werkzeug.routing
class WebSocketClient(object):
'''
Default WebSocket client has a blocking recieve method, but still exports
rest of uWSGI API.
'''
def __init__(self, environ, fd, timeout=60):
... | 30.94958 | 106 | 0.640239 | import os
import sys
import uuid
from ._uwsgi import uwsgi
from gevent.monkey import patch_all
import werkzeug.routing
class WebSocketClient(object):
def __init__(self, environ, fd, timeout=60):
self.environ = environ
self.fd = fd
self.timeout = timeout
self.id = str(uuid... | true | true |
1c2bd9983a1a0b99807debe83fa9f61f992689b4 | 3,961 | py | Python | api/dorest/dorest/configs/funcs.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | null | null | null | api/dorest/dorest/configs/funcs.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | 6 | 2020-11-25T10:49:45.000Z | 2021-09-22T18:50:03.000Z | api/dorest/dorest/configs/funcs.py | ichise-laboratory/uwkgm | 6505fa5d524336b30505804a3d241143cb1fa4bf | [
"BSD-3-Clause"
] | 1 | 2020-12-24T02:15:42.000Z | 2020-12-24T02:15:42.000Z | """Predefined functions for YAML/JSON configuration files
Refer to __init__.py in this module's package for usage
The Dorest project
:copyright: (c) 2020 Ichise Laboratory at NII & AIST
:author: Rungsiman Nararatwong
"""
import importlib
import os
from typing import Any, Dict, List, Union
import yaml
from django.con... | 37.367925 | 154 | 0.695784 |
import importlib
import os
from typing import Any, Dict, List, Union
import yaml
from django.conf import settings
from django.utils.crypto import get_random_string
from dorest.configs.consts import SUPPORTED_FILE_TYPES
def load_usr_pwd(*, path: str, username: str) -> Union[str, None]:
files = sorted([file for... | true | true |
1c2bdb0fe6942436fcb97e18761d122d3ee8e8b1 | 20,030 | py | Python | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | null | null | null | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | 1 | 2021-07-18T14:50:40.000Z | 2021-07-18T15:31:38.000Z | bot/client.py | potocnikluka/discord-utility-bot | 6ccd808043812579278244dcaac1a5ce473d77cc | [
"MIT"
] | 1 | 2021-10-10T10:06:49.000Z | 2021-10-10T10:06:49.000Z | import os
import inspect
import sys
import traceback
import nextcord
import logging
from functools import partial
import bot.commands as commands
import bot.games as games
import bot.decorators as decorators
import bot.utils as utils
class UtilityClient(nextcord.Client):
"""Client connection handling events reci... | 38.298279 | 79 | 0.570444 | import os
import inspect
import sys
import traceback
import nextcord
import logging
from functools import partial
import bot.commands as commands
import bot.games as games
import bot.decorators as decorators
import bot.utils as utils
class UtilityClient(nextcord.Client):
def __init__(self, *, version, database,... | true | true |
1c2bdce8b5cb4cf01ff364e7c93fcedef0b4ad64 | 35,025 | py | Python | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 9 | 2020-10-04T06:20:40.000Z | 2021-05-19T06:25:54.000Z | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 1 | 2021-01-21T04:20:52.000Z | 2021-01-21T04:20:52.000Z | fairseq/models/dlcl_transformer.py | libeineu/SDT-Training | d33a836c1b3258748ec11c4d64998e0dcc9792df | [
"BSD-3-Clause"
] | 1 | 2021-01-19T06:12:27.000Z | 2021-01-19T06:12:27.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
# author: Bei Li
# email: libei_ne... | 43.081181 | 119 | 0.643198 |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options, utils
from fairseq.modules import (
AdaptiveInput, AdaptiveSoftmax, CharacterTokenEmbedder, LayerNorm,
LearnedPositionalEmbedding, MultiheadAttention, SinusoidalPositionalEmbedding,
Relat... | true | true |
1c2bdd7bd7931d3e116412a7d8fdf90c2c822f40 | 4,663 | py | Python | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | 5 | 2017-12-08T09:57:17.000Z | 2019-01-16T12:50:42.000Z | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | 1 | 2019-04-06T08:35:00.000Z | 2019-04-06T08:35:00.000Z | u2socks5.py | thisforeda/unicorn | 16ea5e05912850926cc897ec2bc20db09b7b50cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#encoding=utf8
#
# Copyright 2017 thisforeda
#
# 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 req... | 29.700637 | 106 | 0.551147 |
import struct
import socket
import asyncio
import functools
from unicorn import BaseProtocol
P = struct.pack
U = struct.unpack
UP = lambda b: U("!H", b)[0]
class SOCKS5(BaseProtocol):
STAGE_CONN_MADE = 0
STAGE_AUTH_DONE = 2
STAGE_TUNNEL_STREAMING = 3
ATYPE_DOMAIN = 3
ATYPE_IPV4... | true | true |
1c2bdda1cd6e99640ba34b990716e88ead6bbeea | 13,262 | py | Python | pyWAPOR/ETLook/radiation.py | hectornieto/wapor-et-look | bc0b98be58d1680de2f82909809ac876f78f2d85 | [
"Apache-2.0"
] | 1 | 2021-05-24T08:12:03.000Z | 2021-05-24T08:12:03.000Z | pyWAPOR/ETLook/radiation.py | hectornieto/wapor-et-look | bc0b98be58d1680de2f82909809ac876f78f2d85 | [
"Apache-2.0"
] | 2 | 2020-06-25T08:27:55.000Z | 2020-08-28T07:38:17.000Z | pyWAPOR/ETLook/radiation.py | DHI-GRAS/wapor-et-look | e05b8f24616af8fc99ac1d646c878b353cb35aef | [
"Apache-2.0"
] | 4 | 2020-09-23T09:51:59.000Z | 2021-08-10T08:59:14.000Z | import numpy as np
from pyWAPOR.ETLook import constants as c
def interception_wm2(int_mm, lh_24):
r"""
Computes the energy equivalent for the interception in Wm-2 if it
is provide in mm/day
.. math ::
I = \frac{\lambda I^*}{86400}
Parameters
----------
int_mm : float
inter... | 22.826162 | 114 | 0.54856 | import numpy as np
from pyWAPOR.ETLook import constants as c
def interception_wm2(int_mm, lh_24):
return int_mm * (lh_24/c.day_sec)
def soil_fraction(lai):
return np.exp(-0.6*lai)
def longwave_radiation_fao_etref(t_air_k_24, vp_24, trans_24):
vp_slope=0.14
vp_offset=0.34
lw_slope=1.35
lw_o... | true | true |
1c2bdda97544d685b3b4c3ba20721a0f071f60d9 | 3,824 | py | Python | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,610 | 2020-10-01T14:14:53.000Z | 2022-03-31T18:02:31.000Z | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 1,959 | 2020-09-30T20:22:42.000Z | 2022-03-31T23:58:37.000Z | reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/src/evaluate-coach.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,052 | 2020-09-30T22:11:46.000Z | 2022-03-31T23:02:51.000Z | import argparse
import os
import rl_coach
from rl_coach.base_parameters import Frameworks, TaskParameters
from rl_coach.core_types import EnvironmentSteps
from sagemaker_rl.coach_launcher import CoachConfigurationList, SageMakerCoachPresetLauncher
def inplace_replace_in_file(filepath, old, new):
with open(filepa... | 39.020408 | 103 | 0.664487 | import argparse
import os
import rl_coach
from rl_coach.base_parameters import Frameworks, TaskParameters
from rl_coach.core_types import EnvironmentSteps
from sagemaker_rl.coach_launcher import CoachConfigurationList, SageMakerCoachPresetLauncher
def inplace_replace_in_file(filepath, old, new):
with open(filepa... | true | true |
1c2bddb37a35a95625d7b40d40467e4b804ab7b0 | 15,925 | py | Python | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/operations/debug_ops.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 32.566462 | 114 | 0.565777 |
from types import FunctionType, MethodType
from mindspore import context
from ..._checkparam import Validator as validator
from ..._checkparam import Rel
from ...common import dtype as mstype
from ..primitive import prim_attr_register, PrimitiveWithInfer
def _check_mode(class_name):
mode = context... | true | true |
1c2bde7e21b5791e6b0be6b7981c4980a2ceffae | 1,817 | py | Python | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | clonebuild.py | pombreda/pydee | 133609d4e378361d968e7a06baa11256e0e2f403 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © 2009 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see pydeelib/__init__.py for details)
"""
Cloning Pydee mercurial repository
Building:
.tar.gz source distribution package
.exe and .egg installers
"""
import os, shutil, tarfile
import o... | 31.327586 | 76 | 0.678041 |
import os, shutil, tarfile
import os.path as osp
import pydeelib as mod
name = 'pydee'
parentdir = osp.join(os.getcwd(), osp.pardir)
version = '%s-%s' % (name, mod.__version__)
os.chdir(parentdir)
if osp.isdir(version):
%s' % (name, version))
on, "w|gz")
tar.add(version, recursive=True)
ta... | true | true |
1c2be15f633c8e26a248021a3d87732554d93dc9 | 958 | py | Python | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/python-codes/modules/databases/mysql/modules/theory-practice/src/insert_into_function.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | import mysql.connector
def insert_varibles_into_table(id, name, price, purchase_date):
try:
connection = mysql.connector.connect(
host='localhost',
database='Electronics',
user='root',
password='toor'
)
except mysql.connector.Error as error:
print("Failed to insert into MySQL ta... | 29.9375 | 64 | 0.655532 | import mysql.connector
def insert_varibles_into_table(id, name, price, purchase_date):
try:
connection = mysql.connector.connect(
host='localhost',
database='Electronics',
user='root',
password='toor'
)
except mysql.connector.Error as error:
print("Failed to insert into MySQL ta... | true | true |
1c2be3fa240a7a8e67431b08479f6796c2934516 | 16,344 | py | Python | spark_auto_mapper_fhir/resources/evidence.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/resources/evidence.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/resources/evidence.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union
# noinspection PyPackageRequirements
from pyspark.sql.types import StructType, DataType
from spark_auto_mapper_fhir.fhir_types.date import FhirDate
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_m... | 51.396226 | 117 | 0.711331 | from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union
from pyspark.sql.types import StructType, DataType
from spark_auto_mapper_fhir.fhir_types.date import FhirDate
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_mapper_fhir.fhir_types.list import Fh... | true | true |
1c2be47f10631d5a8e7cf6eb4ce1ccb2182f99fc | 5,849 | py | Python | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | 1 | 2021-06-16T02:57:18.000Z | 2021-06-16T02:57:18.000Z | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | null | null | null | k8sclient/models/v1_endpoint_subset.py | Arvinhub/client-python | d67df30f635231d68dc4c20b9b7e234c616c1e6a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: unversioned
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Licens... | 32.675978 | 215 | 0.622158 |
from pprint import pformat
from six import iteritems
import re
class V1EndpointSubset(object):
def __init__(self, addresses=None, not_ready_addresses=None, ports=None):
self.swagger_types = {
'addresses': 'list[V1EndpointAddress]',
'not_ready_addresses': 'list[V1EndpointAddress]... | true | true |
1c2be5f8b532542090580e19f142e26cb4f30576 | 304 | py | Python | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | src_cs/f2py/importTest.py | marcomangano/idwarp | 3e0d4837a9b926b1cd227654365ca4adfbc08cbe | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import sys
name = 'idwarp_cs'
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except Exception as err:
print("Error: %s." % err)
sys.exit(1)
# end try
print("Module %s was successfully imported." % name)
| 19 | 55 | 0.657895 |
import sys
name = 'idwarp_cs'
print("Testing if module %s can be imported..." % name)
import_cmd = "import %s" % name
try:
exec(import_cmd)
except Exception as err:
print("Error: %s." % err)
sys.exit(1)
print("Module %s was successfully imported." % name)
| true | true |
1c2be683bc08652843c9c39c1d44570e125e0e4a | 2,496 | py | Python | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | null | null | null | src/programy/parser/template/nodes/normalise.py | ItsPhant/program-y | c2b211fcaf8cedc7d6d95a8ea9470a913efa1622 | [
"MIT"
] | 1 | 2020-02-21T17:58:05.000Z | 2020-02-21T17:58:05.000Z | """
Copyright (c) 2016-17 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, mod... | 40.918033 | 120 | 0.658253 |
import logging
from programy.parser.template.nodes.base import TemplateNode
| true | true |
1c2be7b6bf5c647793eaa54f0ac554ba1e28e82b | 11,671 | py | Python | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | autobahn/autobahn/wamp/test/test_protocol.py | luhn/AutobahnPython | 7d519052ab42dc029598ab9e2dbdd7af8e08341f | [
"Apache-2.0"
] | null | null | null | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | 36.021605 | 197 | 0.630966 | yield self.assertFailure(handler.publish(u'', options = options), InvalidUri)
@inlineCallbacks
def test_call(self):
handler = ApplicationSession()
MockTransport(handler)
res = yield handler.call(u'com.myapp.procedure1')
self.assertEqual(res, 100)
res = yie... | true | true |
1c2be827a79715beef77ec9b12b82a536c44c9a2 | 2,175 | py | Python | setup.py | sleepy-owl/hummingbird | d23d8f2eb6864f88461fe1e0044f2f981b7d5881 | [
"MIT"
] | 1 | 2021-02-25T19:55:49.000Z | 2021-02-25T19:55:49.000Z | setup.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | setup.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
import os
import sys
this = os.path.dirname(__file__)
packages = find_packages()
assert packages
# read version from the package file.
with (open(os.path.join(this, "hummingbird/__init__.py"), "r")) as f:
line = [_ for _ in [_.strip("\r\n ") f... | 30.633803 | 96 | 0.645517 | from distutils.core import setup
from setuptools import find_packages
import os
import sys
this = os.path.dirname(__file__)
packages = find_packages()
assert packages
with (open(os.path.join(this, "hummingbird/__init__.py"), "r")) as f:
line = [_ for _ in [_.strip("\r\n ") for _ in f.readlines()] if _.startswit... | true | true |
1c2bea7f40256e88ea7c3a0fe6b7339cd1b14381 | 8,781 | py | Python | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | WISDEM/wisdem/commonse/akima.py | ebranlard/WEIS | 59851a0c3b2e801bd413ca4887ab4b78e58f928a | [
"Apache-2.0"
] | null | null | null | """
Simple interpolant based on Andrew Ning's implementation of Akima splines.
Includes derivatives wrt training points. Akima spline is regenerated during each compute.
https://github.com/andrewning/akima
"""
import numpy as np
def abs_smooth_dv(x, x_deriv, delta_x):
"""
Compute the absolute value in a smoo... | 33.135849 | 115 | 0.439016 | import numpy as np
def abs_smooth_dv(x, x_deriv, delta_x):
if x >= delta_x:
y_deriv = x_deriv
y = x
elif x <= -delta_x:
y_deriv = -x_deriv
y = -x
else:
y_deriv = 2.0 * x * x_deriv / (2.0 * delta_x)
y = x ** 2 / (2.0 * delta_x) + delta_x / 2.0
return y... | true | true |
1c2beb0e3e9708ace96894a559d9ac33ce15a4c7 | 2,998 | py | Python | stemmer/find_potential_stems.py | Esukhia/text_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | 1 | 2017-01-26T22:37:57.000Z | 2017-01-26T22:37:57.000Z | stemmer/find_potential_stems.py | Esukhia/tibtext_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | null | null | null | stemmer/find_potential_stems.py | Esukhia/tibtext_utils | 562065d4dedba127f8aaeee03ca3d9f071805f62 | [
"MIT"
] | null | null | null | from collections import defaultdict
from PyTib.common import open_file, write_csv, tib_sort
def format_families(families):
lemmas_sorted = tib_sort(list(families.keys()))
formatted = []
for lemma in lemmas_sorted:
members = families[lemma]
formatted.append('{}: {}'.format(lemma, ' '.... | 37.475 | 104 | 0.641761 | from collections import defaultdict
from PyTib.common import open_file, write_csv, tib_sort
def format_families(families):
lemmas_sorted = tib_sort(list(families.keys()))
formatted = []
for lemma in lemmas_sorted:
members = families[lemma]
formatted.append('{}: {}'.format(lemma, ' '.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.