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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08fb46df59da5fe713f3de13e078391a0e57ac3f | 893 | py | Python | bike_lock.py | kilbyjmichael/BikeLock | ecb32ee622d2cafaa6b4cd81634541f373f6d66f | [
"MIT"
] | 2 | 2015-09-16T18:37:41.000Z | 2015-09-24T18:14:05.000Z | bike_lock.py | kilbyjmichael/BikeLock | ecb32ee622d2cafaa6b4cd81634541f373f6d66f | [
"MIT"
] | null | null | null | bike_lock.py | kilbyjmichael/BikeLock | ecb32ee622d2cafaa6b4cd81634541f373f6d66f | [
"MIT"
] | null | null | null | #!/usr/bin/python
import itertools
import mmap
bike_lock_c1 = ['d', 'm', 'r', 'f', 'b', 'l', 'p', 'w', 's', 't']
bike_lock_c2 = ['a', 'i', 'o', 'l', 'e', 'h', 'w', 'r', 'y', 'u']
bike_lock_c3 = ['n', 's', 'k', 'o', 'a', 'l', 'e', 'r', 'm', 't']
bike_lock_c4 = ['g', 'k', 'm', 's', 't', 'e', 'p', 'y', 'l', 'd']
... | 31.892857 | 90 | 0.527436 |
import itertools
import mmap
bike_lock_c1 = ['d', 'm', 'r', 'f', 'b', 'l', 'p', 'w', 's', 't']
bike_lock_c2 = ['a', 'i', 'o', 'l', 'e', 'h', 'w', 'r', 'y', 'u']
bike_lock_c3 = ['n', 's', 'k', 'o', 'a', 'l', 'e', 'r', 'm', 't']
bike_lock_c4 = ['g', 'k', 'm', 's', 't', 'e', 'p', 'y', 'l', 'd']
def main():
... | true | true |
08fb492357c65f796d0f0325993dd61f8db6e50a | 752 | py | Python | slyyyy/3/diagnostic_part1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | 5 | 2021-12-01T21:44:22.000Z | 2021-12-09T19:11:21.000Z | slyyyy/3/diagnostic_part1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | null | null | null | slyyyy/3/diagnostic_part1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | 3 | 2021-12-01T21:41:20.000Z | 2021-12-03T14:17:24.000Z | import os, sys, math
def main():
def most_common(sum, num_items):
if(sum > num_items / 2):
return 1
else:
return 0
def calc_gamma_rate(digits, num_items, num_bits):
gamma_rate = 0
for i in range(num_bits):
gamma_rate += math.pow(2,i)*most_common(digits[num_bits-i-1], num_items)
return int(gamma_r... | 24.258065 | 75 | 0.672872 | import os, sys, math
def main():
def most_common(sum, num_items):
if(sum > num_items / 2):
return 1
else:
return 0
def calc_gamma_rate(digits, num_items, num_bits):
gamma_rate = 0
for i in range(num_bits):
gamma_rate += math.pow(2,i)*most_common(digits[num_bits-i-1], num_items)
return int(gamma_r... | true | true |
08fb4addff9b63179867cc76b34daaac63afc2c8 | 7,526 | py | Python | Parser/articleparser.py | jackmeldrum/Chronicling-America-Parser | d38353f8b3e3d1cc15cdfba3e001f2843bdbc752 | [
"MIT"
] | 1 | 2020-03-30T04:28:13.000Z | 2020-03-30T04:28:13.000Z | Parser/articleparser.py | jackmeldrum/Chronicling-America-Parser | d38353f8b3e3d1cc15cdfba3e001f2843bdbc752 | [
"MIT"
] | null | null | null | Parser/articleparser.py | jackmeldrum/Chronicling-America-Parser | d38353f8b3e3d1cc15cdfba3e001f2843bdbc752 | [
"MIT"
] | null | null | null | import math
from xml.sax import handler, parse
def parsefile(f: object) -> object:
h = Alto()
try:
parse(f, h)
except KeyError:
return None
return h
class Page:
def __init__(self, attrs):
self.size = (float(attrs['WIDTH']), float(attrs['HEIGHT']))
se... | 32.025532 | 87 | 0.526043 | import math
from xml.sax import handler, parse
def parsefile(f: object) -> object:
h = Alto()
try:
parse(f, h)
except KeyError:
return None
return h
class Page:
def __init__(self, attrs):
self.size = (float(attrs['WIDTH']), float(attrs['HEIGHT']))
se... | true | true |
08fb4be8b703556d0dbdbf48933d5c7f1aab5c9d | 2,490 | py | Python | sdk/bento/ecs/base.py | bentobox-dev/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 1 | 2021-01-02T02:50:15.000Z | 2021-01-02T02:50:15.000Z | sdk/bento/ecs/base.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 48 | 2020-10-21T07:42:30.000Z | 2021-02-15T19:34:55.000Z | sdk/bento/ecs/base.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | null | null | null | #
# Bentobox
# SDK - ECS
# Base classes
#
from typing import FrozenSet, List, Any, Set, Union
from abc import ABC, abstractmethod, abstractproperty
from bento.spec.ecs import ComponentDef
class Component(ABC):
"""Component represents a ECS Component in the Engine. """
@abstractproperty
def component_na... | 27.977528 | 90 | 0.612851 |
from typing import FrozenSet, List, Any, Set, Union
from abc import ABC, abstractmethod, abstractproperty
from bento.spec.ecs import ComponentDef
class Component(ABC):
@abstractproperty
def component_name(self):
pass
@abstractmethod
def get_attr(self, name: str) -> Any:
pass
d... | true | true |
08fb4bf100dee3a01293692eac0fb45e3f61aa61 | 1,407 | py | Python | startup_scripts/010_groups.py | naturalis/docker-netbox | dfecdc4a131205c1d991d9b4b6775d5c9f13ae47 | [
"Apache-2.0"
] | null | null | null | startup_scripts/010_groups.py | naturalis/docker-netbox | dfecdc4a131205c1d991d9b4b6775d5c9f13ae47 | [
"Apache-2.0"
] | null | null | null | startup_scripts/010_groups.py | naturalis/docker-netbox | dfecdc4a131205c1d991d9b4b6775d5c9f13ae47 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.models import Permission, Group, User
from ruamel.yaml import YAML
from pathlib import Path
import sys
file = Path('/opt/netbox/initializers/groups.yml')
if not file.is_file():
sys.exit()
with file.open('r') as stream:
yaml=YAML(typ='safe')
groups = yaml.load(stream)
if groups is not... | 33.5 | 104 | 0.653873 | from django.contrib.auth.models import Permission, Group, User
from ruamel.yaml import YAML
from pathlib import Path
import sys
file = Path('/opt/netbox/initializers/groups.yml')
if not file.is_file():
sys.exit()
with file.open('r') as stream:
yaml=YAML(typ='safe')
groups = yaml.load(stream)
if groups is not... | true | true |
08fb4c5e9c1fdb3f91fac358bedd9fb7eea40723 | 3,507 | py | Python | workers/tests/test_median.py | Open-EO/openeo-sentinelhub-python-driver | 92f990f098065ffb658eba6dca291dd1d5fc70f2 | [
"Apache-2.0"
] | 2 | 2019-12-03T12:49:47.000Z | 2020-10-25T20:14:39.000Z | workers/tests/test_median.py | Open-EO/openeo-sentinelhub-python-driver | 92f990f098065ffb658eba6dca291dd1d5fc70f2 | [
"Apache-2.0"
] | 5 | 2019-12-03T10:32:48.000Z | 2020-10-09T13:07:39.000Z | workers/tests/test_median.py | Open-EO/openeo-sentinelhub-python-driver | 92f990f098065ffb658eba6dca291dd1d5fc70f2 | [
"Apache-2.0"
] | 4 | 2020-03-06T14:51:52.000Z | 2020-11-24T10:30:18.000Z | import pytest
import sys, os
import xarray as xr
import numpy as np
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import process
from process._common import ProcessArgumentInvalid, ProcessArgumentRequired
@pytest.fixture
def generate_data():
def _construct(
data = [[[[0... | 40.310345 | 164 | 0.600513 | import pytest
import sys, os
import xarray as xr
import numpy as np
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import process
from process._common import ProcessArgumentInvalid, ProcessArgumentRequired
@pytest.fixture
def generate_data():
def _construct(
data = [[[[0... | true | true |
08fb4cbc4da613be533fb84b279c4b7736490813 | 6,084 | py | Python | cassweb_splitarrests.py | jganseman/cassatie-be | 85ae602f56dce935fd80facc1ac3ded805a3cc40 | [
"MIT"
] | null | null | null | cassweb_splitarrests.py | jganseman/cassatie-be | 85ae602f56dce935fd80facc1ac3ded805a3cc40 | [
"MIT"
] | null | null | null | cassweb_splitarrests.py | jganseman/cassatie-be | 85ae602f56dce935fd80facc1ac3ded805a3cc40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# author: Joachim Ganseman
### Split the OCR-ed Cassation arrests into separate arrests
# This currently works for arrests from the year 2000 onwards.
# Split done by regex, based on formatting as outputted from the xpdf tool
#
# Still needs work to be more complete!
from os imp... | 38.751592 | 133 | 0.651545 |
from os import listdir, path, remove, makedirs, getcwd
from os.path import join, exists
import math
import time
import unicodedata
import re
dataroot = getcwd()
dataset = "cassweb"
TXT_DIR = join(dataroot, dataset,"text-xpdf")
OUTPUT_DIR = join(dataroot, dataset,"text-xpdf-split")if not exists(OUTPUT_DIR):
prin... | true | true |
08fb4d12663820f9798f1a5f898f5f0368c810ec | 6,277 | py | Python | pyro/distributions/transforms/batchnorm.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/batchnorm.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/batchnorm.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
import torch.nn as nn
from torch.distributions import constraints
import torch.nn.functional as F
from pyro.distributions.torch_transform import TransformModule
from pyro.distributions.util import copy_docs_from
@co... | 41.569536 | 120 | 0.680102 |
import torch
import torch.nn as nn
from torch.distributions import constraints
import torch.nn.functional as F
from pyro.distributions.torch_transform import TransformModule
from pyro.distributions.util import copy_docs_from
@copy_docs_from(TransformModule)
class BatchNorm(TransformModule):
domain = constraint... | true | true |
08fb4d56f6c3caae481b23dd09a63aa30fd0fd75 | 447 | py | Python | scripts/npc/elizaHarp7.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/npc/elizaHarp7.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/npc/elizaHarp7.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | # Harp String <B> (2012033) | Eliza's Garden (920020000)
# Author: Tiger, Pyonta
sm.playSound("orbis/si", 100)
eternalSleep = 3114
songStatus = sm.getQRValue(eternalSleep)
if sm.hasQuest(eternalSleep) and songStatus != "42":
# B is never used in the song, so...
# Uh oh, you screwed up
songProgress = ""
... | 29.8 | 74 | 0.700224 | # Author: Tiger, Pyonta
sm.playSound("orbis/si", 100)
eternalSleep = 3114
songStatus = sm.getQRValue(eternalSleep)
if sm.hasQuest(eternalSleep) and songStatus != "42":
# B is never used in the song, so...
# Uh oh, you screwed up
songProgress = ""
sm.chat("The performance was a failure. Eliza seems ve... | true | true |
08fb4d6d64bdc08f76361b8a89eefb9139c27584 | 370 | py | Python | src/tm1602_exporter/__main__.py | sashkab/tm1602_exporter | c955c4d1737df8a9f289c2185cc574100030cc37 | [
"Apache-2.0"
] | 1 | 2021-07-17T19:09:21.000Z | 2021-07-17T19:09:21.000Z | src/tm1602_exporter/__main__.py | sashkab/tm1602_exporter | c955c4d1737df8a9f289c2185cc574100030cc37 | [
"Apache-2.0"
] | null | null | null | src/tm1602_exporter/__main__.py | sashkab/tm1602_exporter | c955c4d1737df8a9f289c2185cc574100030cc37 | [
"Apache-2.0"
] | 1 | 2021-08-12T02:49:25.000Z | 2021-08-12T02:49:25.000Z | """Main tool"""
from time import sleep
import prometheus_client
from . import Collector
def main():
"""Register collector and serve it via HTTP"""
prometheus_client.REGISTRY.register(Collector())
print("serving on :9116", flush=True)
prometheus_client.start_http_server(9116)
while True:
... | 17.619048 | 52 | 0.686486 | from time import sleep
import prometheus_client
from . import Collector
def main():
prometheus_client.REGISTRY.register(Collector())
print("serving on :9116", flush=True)
prometheus_client.start_http_server(9116)
while True:
sleep(5)
if __name__ == "__main__":
main()
| true | true |
08fb4da6c478174b9f88c9914c904a3ecfc23ba0 | 3,559 | gyp | Python | o3d/import/import.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 2 | 2017-09-02T19:08:28.000Z | 2021-11-15T15:15:14.000Z | o3d/import/import.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | null | null | null | o3d/import/import.gyp | Gitman1989/chromium | 2b1cceae1075ef012fb225deec8b4c8bbe4bc897 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'include_dirs': [
'..',... | 25.241135 | 76 | 0.469514 |
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'include_dirs': [
'..',
'../..',
'../../<(cgdir)/include',
'../../<(glewdir)/include',
'../../<(gtestdir)',
],
},
'targets': [
{
'target_name': 'o3... | true | true |
08fb4e693357f5021c0adbbd7c4fcdb425b00785 | 24 | py | Python | Secondus/testing.py | TrentConley/ITurk | 9f06805c442f86992529d2247a9a506db24c1307 | [
"MIT"
] | 1 | 2020-05-16T22:38:34.000Z | 2020-05-16T22:38:34.000Z | Secondus/testing.py | TrentConley/ITurk | 9f06805c442f86992529d2247a9a506db24c1307 | [
"MIT"
] | null | null | null | Secondus/testing.py | TrentConley/ITurk | 9f06805c442f86992529d2247a9a506db24c1307 | [
"MIT"
] | 1 | 2020-05-15T20:43:05.000Z | 2020-05-15T20:43:05.000Z | print ('this is a test') | 24 | 24 | 0.666667 | print ('this is a test') | true | true |
08fb4eb5c74ec72d1b8f4d5e6713b5304e7af83e | 20,502 | py | Python | indy_node/server/domain_req_handler.py | a-fox/indy-node | c46a02aed783bbd781d977f0dcee5766ee8b603b | [
"Apache-2.0"
] | null | null | null | indy_node/server/domain_req_handler.py | a-fox/indy-node | c46a02aed783bbd781d977f0dcee5766ee8b603b | [
"Apache-2.0"
] | null | null | null | indy_node/server/domain_req_handler.py | a-fox/indy-node | c46a02aed783bbd781d977f0dcee5766ee8b603b | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
from typing import List
import base58
from indy_common.auth import Authoriser
from indy_common.constants import NYM, ROLE, ATTRIB, SCHEMA, CLAIM_DEF, REF, \
GET_NYM, GET_ATTR, GET_SCHEMA, GET_CLAIM_DEF, SIGNATURE_TYPE, REVOC_REG_DEF
from indy_common.roles import Roles
from indy_common.st... | 40.43787 | 100 | 0.565652 | from copy import deepcopy
from typing import List
import base58
from indy_common.auth import Authoriser
from indy_common.constants import NYM, ROLE, ATTRIB, SCHEMA, CLAIM_DEF, REF, \
GET_NYM, GET_ATTR, GET_SCHEMA, GET_CLAIM_DEF, SIGNATURE_TYPE, REVOC_REG_DEF
from indy_common.roles import Roles
from indy_common.st... | true | true |
08fb4ef258bbe139eaf17eedb88b352e78dacbd5 | 119 | py | Python | rettina-core/__init__.py | foss-transportationmodeling/rettina-core | 0d8a172268866cafb3882ffdec7fc120143c49bb | [
"0BSD"
] | 1 | 2017-01-30T22:48:25.000Z | 2017-01-30T22:48:25.000Z | vista-gui/__init__.py | foss-transportationmodeling/vista-gui | 7fe2c780d2de6b876d92fb28261f7a7876a88b54 | [
"0BSD"
] | null | null | null | vista-gui/__init__.py | foss-transportationmodeling/vista-gui | 7fe2c780d2de6b876d92fb28261f7a7876a88b54 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Karthik C Konduri'
__email__ = 'karthik.charan@gmail.com'
__version__ = '0.1.0'
| 19.833333 | 38 | 0.663866 |
__author__ = 'Karthik C Konduri'
__email__ = 'karthik.charan@gmail.com'
__version__ = '0.1.0'
| true | true |
08fb50215356b93ada75a4439cfbf233a0ca6019 | 1,844 | py | Python | networking_cisco/plugins/ml2/drivers/cisco/n1kv/exceptions.py | cisco-openstack/networking-cisco | fbe7e1b4bc944d0c50491c09244afa3e56384b36 | [
"Apache-2.0"
] | 2 | 2015-08-13T00:07:45.000Z | 2021-05-06T09:46:02.000Z | networking_cisco/plugins/ml2/drivers/cisco/n1kv/exceptions.py | cisco-openstack/networking-cisco | fbe7e1b4bc944d0c50491c09244afa3e56384b36 | [
"Apache-2.0"
] | null | null | null | networking_cisco/plugins/ml2/drivers/cisco/n1kv/exceptions.py | cisco-openstack/networking-cisco | fbe7e1b4bc944d0c50491c09244afa3e56384b36 | [
"Apache-2.0"
] | 1 | 2021-03-22T16:54:57.000Z | 2021-03-22T16:54:57.000Z | # Copyright 2015 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 36.156863 | 78 | 0.712581 |
from neutron.common import exceptions
class VSMConnectionFailed(exceptions.ServiceUnavailable):
message = _("Connection to VSM failed: %(reason)s.")
class VSMError(exceptions.NeutronException):
message = _("Internal VSM Error: %(reason)s.")
class NetworkBindingNotFound(exceptions.NotFound):
message ... | true | true |
08fb509d1053a21b02212fa54b8794c414902508 | 3,897 | py | Python | peeringdb_server/management/commands/pdb_load_data.py | vegu/peeringdb | b4a025c912f14706642d7edc9db6da998e024b8f | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/management/commands/pdb_load_data.py | vegu/peeringdb | b4a025c912f14706642d7edc9db6da998e024b8f | [
"BSD-2-Clause"
] | null | null | null | peeringdb_server/management/commands/pdb_load_data.py | vegu/peeringdb | b4a025c912f14706642d7edc9db6da998e024b8f | [
"BSD-2-Clause"
] | null | null | null | import logging
import datetime
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models.signals import post_save, pre_delete, pre_save
from django.conf import settings
from peeringdb... | 33.025424 | 96 | 0.602771 | import logging
import datetime
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models.signals import post_save, pre_delete, pre_save
from django.conf import settings
from peeringdb... | true | true |
08fb50b7a194638e76e8d3b17eb8f771a6349c24 | 1,170 | py | Python | tests/storage/cases/test_KT1H61HTVumKHa6ZDFBuJGAF9ZDWURDdahfk_babylon.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | tests/storage/cases/test_KT1H61HTVumKHa6ZDFBuJGAF9ZDWURDdahfk_babylon.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/storage/cases/test_KT1H61HTVumKHa6ZDFBuJGAF9ZDWURDdahfk_babylon.py | tqtezos/pytezos | a4ac0b022d35d4c9f3062609d8ce09d584b5faa8 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1H61HTVumKHa6ZDFBuJGAF9ZDWURDdahfk_babylon(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
... | 41.785714 | 112 | 0.757265 | from unittest import TestCase
from tests import get_data
from pytezos.michelson.converter import build_schema, decode_micheline, encode_micheline, micheline_to_michelson
class StorageTestKT1H61HTVumKHa6ZDFBuJGAF9ZDWURDdahfk_babylon(TestCase):
@classmethod
def setUpClass(cls):
cls.maxDiff = None
... | true | true |
08fb514f1adaf074c0ad9c8d0a1a42a25fa1ad13 | 275 | py | Python | Hackerrank-Solutions/No Idea!!!.py | rohitsinghkcodes/Hactober-CP-contributions | 6485be897a1a51892e4b874da0e2a050b78bc225 | [
"MIT"
] | 7 | 2020-10-04T05:14:59.000Z | 2020-10-12T19:30:30.000Z | Hackerrank-Solutions/No Idea!!!.py | rohitsinghkcodes/Hactober-CP-contributions | 6485be897a1a51892e4b874da0e2a050b78bc225 | [
"MIT"
] | 7 | 2020-10-06T11:56:57.000Z | 2020-10-28T21:19:05.000Z | Hackerrank-Solutions/No Idea!!!.py | rohitsinghkcodes/Hactober-CP-contributions | 6485be897a1a51892e4b874da0e2a050b78bc225 | [
"MIT"
] | 44 | 2020-10-04T02:53:09.000Z | 2021-10-17T09:43:25.000Z | happy=0;
n,m=map(int,input().split());
lst=list(map(int,input().split()));
A=set(map(int,input().split()));
B=set(map(int,input().split()));
for i in lst:
if (i in A)==1:
happy+=1;
elif (i in B)==1:
happy-=1;
else:
continue;
print(happy);
| 19.642857 | 35 | 0.530909 | happy=0;
n,m=map(int,input().split());
lst=list(map(int,input().split()));
A=set(map(int,input().split()));
B=set(map(int,input().split()));
for i in lst:
if (i in A)==1:
happy+=1;
elif (i in B)==1:
happy-=1;
else:
continue;
print(happy);
| true | true |
08fb51510639d77ade232d508f2989f2abc742f9 | 3,936 | py | Python | src/lib/pythonds/trees/balance.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | src/lib/pythonds/trees/balance.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | src/lib/pythonds/trees/balance.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | #!/bin/env python3.1
# Bradley N. Miller, David L. Ranum
# Introduction to Data Structures and Algorithms in Python
# Copyright 2005, 2010
#
from .bst import BinarySearchTree, TreeNode
class AVLTree(BinarySearchTree):
'''
Author: Brad Miller
Date: 1/15/2005
Description: Imlement a binary search tr... | 35.142857 | 89 | 0.552846 |
from .bst import BinarySearchTree, TreeNode
class AVLTree(BinarySearchTree):
def _put(self,key,val,currentNode):
if key < currentNode.key:
if currentNode.hasLeftChild():
self._put(key,val,currentNode.leftChild)
else:
currentNode.leftChild = TreeNod... | true | true |
08fb52bbe1766d8bf8ca567934c90714e94150f3 | 2,736 | py | Python | rotation_averaging/tests/test_graph.py | nishant34/RotationAveraging | 79f77482681665fcf0eb16b539238432205b9d54 | [
"MIT"
] | null | null | null | rotation_averaging/tests/test_graph.py | nishant34/RotationAveraging | 79f77482681665fcf0eb16b539238432205b9d54 | [
"MIT"
] | null | null | null | rotation_averaging/tests/test_graph.py | nishant34/RotationAveraging | 79f77482681665fcf0eb16b539238432205b9d54 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Rafael Marinheiro
# @Date: 2014-10-29 15:06:14
# @Last Modified by: Rafael Marinheiro
# @Last Modified time: 2014-11-21 03:54:12
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Rafael Marinheiro
# @Date: 2014-10-28 02:40:42
# @Last Modified by: ... | 30.065934 | 134 | 0.706506 |
import numpy
import numpy.random
import scipy.linalg
import scipy.sparse
import scipy.sparse.linalg
import unittest
import graph
import compare
import logging
import rotation_averaging
class TestL1Approximation(unittest.TestCase):
def setUp(self):
logging.basicConfig(level=logging.INFO)
graphi = graph.genera... | true | true |
08fb530476b6de58e888fab8d0c5cb4c3d549413 | 22,875 | py | Python | twilio/rest/api/v2010/account/incoming_phone_number/mobile.py | timgates42/twilio-python | ef29d03a4857b62b616df4a8f4f2b7c294afbb99 | [
"MIT"
] | 2 | 2022-01-13T10:58:03.000Z | 2022-03-16T07:12:17.000Z | venv/Lib/site-packages/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 9 | 2018-05-07T21:59:44.000Z | 2022-01-29T22:49:29.000Z | venv/Lib/site-packages/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 4 | 2021-03-25T09:00:08.000Z | 2021-08-05T06:54:23.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page ... | 37.5 | 144 | 0.638164 |
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class MobileList(ListResource):
def __init__(self, version, account_sid):
super(MobileList, s... | true | true |
08fb546e048dd76a2cd99b9fd80601d69def5801 | 95 | py | Python | da_mover.py | James-M-Farmer/pyna | 5f68327992c61d8a31de969937afc89ad31b13b7 | [
"MIT"
] | null | null | null | da_mover.py | James-M-Farmer/pyna | 5f68327992c61d8a31de969937afc89ad31b13b7 | [
"MIT"
] | null | null | null | da_mover.py | James-M-Farmer/pyna | 5f68327992c61d8a31de969937afc89ad31b13b7 | [
"MIT"
] | null | null | null | from sftper import move_it
move_it("10.10.2.4", 22, "fry", "comel.yaml", "comelisciousness")
| 19 | 65 | 0.694737 | from sftper import move_it
move_it("10.10.2.4", 22, "fry", "comel.yaml", "comelisciousness")
| true | true |
08fb5520e6f4eff6591e5014e8959b948abe8828 | 22,903 | py | Python | test/common/service/test_source_format_service.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | test/common/service/test_source_format_service.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | test/common/service/test_source_format_service.py | BloggerBust/bbpyp | 078f940dd38bc3ee7c5adcfb2555c2843a4ca57b | [
"Apache-2.0"
] | null | null | null | import unittest
from mock import Mock, patch
from os import linesep
from bbpyp.abstract_parser.model.indent_delta import IndentDelta
from bbpyp.common.service.source_format_service import SourceFormatService
@patch('test.TestContext', create=True)
class TestSourceFormatService(unittest.TestCase):
def setUp(self... | 57.690176 | 226 | 0.480505 | import unittest
from mock import Mock, patch
from os import linesep
from bbpyp.abstract_parser.model.indent_delta import IndentDelta
from bbpyp.common.service.source_format_service import SourceFormatService
@patch('test.TestContext', create=True)
class TestSourceFormatService(unittest.TestCase):
def setUp(self... | true | true |
08fb56162f6a4ec690416c280f36742d4d086f57 | 1,922 | py | Python | stringops.py | joeavanzato/WARD | cf077d89f01fee9e65996c7b7eab429d915b6c11 | [
"MIT"
] | null | null | null | stringops.py | joeavanzato/WARD | cf077d89f01fee9e65996c7b7eab429d915b6c11 | [
"MIT"
] | null | null | null | stringops.py | joeavanzato/WARD | cf077d89f01fee9e65996c7b7eab429d915b6c11 | [
"MIT"
] | null | null | null | import fs_interaction
class string_operator():
def __init__(self):
self.log_buddy = fs_interaction.log_writer()
def split_items(self,values): #Split REGV into key:value pair -> think about building straight or still using CSV
item_dict = {}
self.log_buddy.write_log("Execution",... | 41.782609 | 157 | 0.600937 | import fs_interaction
class string_operator():
def __init__(self):
self.log_buddy = fs_interaction.log_writer()
def split_items(self,values): item_dict = {}
self.log_buddy.write_log("Execution","SPLITTING "+values+" ON ;")
try:
item_list = values.split(";")... | true | true |
08fb562f9861011baa94320ec1c3bbae2b17835f | 118 | py | Python | src/LinConGauss/core/loop_state.py | alpiges/LinConGauss | eb86d5424cf2761f0c4f7e274aa0821150dc933f | [
"MIT"
] | 9 | 2020-03-13T18:30:05.000Z | 2022-01-23T10:48:01.000Z | src/LinConGauss/core/loop_state.py | alpiges/LinConGauss | eb86d5424cf2761f0c4f7e274aa0821150dc933f | [
"MIT"
] | 5 | 2020-09-02T09:37:28.000Z | 2021-11-02T14:18:22.000Z | src/LinConGauss/core/loop_state.py | alpiges/LinConGauss | eb86d5424cf2761f0c4f7e274aa0821150dc933f | [
"MIT"
] | 1 | 2021-05-03T20:35:53.000Z | 2021-05-03T20:35:53.000Z |
class LoopState():
def __init__(self):
""" Tracks important quantities during the loop """
pass
| 16.857143 | 59 | 0.601695 |
class LoopState():
def __init__(self):
pass
| true | true |
08fb5664986c6a4e795404242fee422b6adbd3bd | 100,092 | py | Python | zerver/tests/test_upload.py | jasonhildebrand/zulip | ca17a452fd270e7f6382aea09382972e818f9bca | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_upload.py | jasonhildebrand/zulip | ca17a452fd270e7f6382aea09382972e818f9bca | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_upload.py | jasonhildebrand/zulip | ca17a452fd270e7f6382aea09382972e818f9bca | [
"Apache-2.0"
] | null | null | null | import datetime
import io
import os
import re
import shutil
import time
import urllib
from io import StringIO
from unittest import mock
from unittest.mock import patch
import botocore.exceptions
import orjson
from django.conf import settings
from django.http.response import StreamingHttpResponse
from django.utils.time... | 43.367418 | 123 | 0.643408 | import datetime
import io
import os
import re
import shutil
import time
import urllib
from io import StringIO
from unittest import mock
from unittest.mock import patch
import botocore.exceptions
import orjson
from django.conf import settings
from django.http.response import StreamingHttpResponse
from django.utils.time... | true | true |
08fb569adb556b74c4893e0833668cbd944bc827 | 609 | py | Python | mundo-2/ex071.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | 2 | 2021-05-06T20:36:36.000Z | 2022-02-17T13:50:07.000Z | mundo-2/ex071.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | null | null | null | mundo-2/ex071.py | RaoniSilvestre/Exercicios-Python | d840a9471dc0ddf805ead0c63f9be5de0fb375af | [
"MIT"
] | 1 | 2021-05-26T02:24:04.000Z | 2021-05-26T02:24:04.000Z | # SIMULADOR DE CAIXA ELETRÔNICO #
import titulo
titulo.titulo("BANCO RAONIS")
Saque = int(input('Quanto você quer sacar? R$'))
céd = 200
total = Saque
totced = 0
while True:
if total >= céd:
total -= céd
totced += 1
else:
print(f'Total de {totced} cédulas de {céd}')
if céd == 200... | 21 | 52 | 0.472906 | import titulo
titulo.titulo("BANCO RAONIS")
Saque = int(input('Quanto você quer sacar? R$'))
céd = 200
total = Saque
totced = 0
while True:
if total >= céd:
total -= céd
totced += 1
else:
print(f'Total de {totced} cédulas de {céd}')
if céd == 200:
céd = 100
el... | true | true |
08fb56a4085fdcdd89aee90926884bb45aa5db73 | 16,132 | py | Python | utils.py | meghu2791/DeepLearningModels | d98190d1cc44f530b9cc6e51fb791c50c8fd5f4f | [
"MIT"
] | 1 | 2021-12-24T06:30:13.000Z | 2021-12-24T06:30:13.000Z | utils.py | meghu2791/DeepLearningModels | d98190d1cc44f530b9cc6e51fb791c50c8fd5f4f | [
"MIT"
] | null | null | null | utils.py | meghu2791/DeepLearningModels | d98190d1cc44f530b9cc6e51fb791c50c8fd5f4f | [
"MIT"
] | 1 | 2021-01-07T12:03:04.000Z | 2021-01-07T12:03:04.000Z | import sys
import os
import operator
import re
import string
import nltk
#Uncomment only for downloading NLTK collections (all): nltk.download()
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
import codecs
import torc... | 37.516279 | 147 | 0.55362 | import sys
import os
import operator
import re
import string
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
import codecs
import torch
from torch import nn
from torch.autograd import Variable
import operat... | true | true |
08fb57f30e61439658a4a0bee1e60294ec453194 | 22,053 | py | Python | yggdrasil/drivers/tests/test_ModelDriver.py | leighmatth/yggdrasil | 5f7bdedf2e790026ddcc40e84ca0078ddcac8316 | [
"BSD-3-Clause"
] | null | null | null | yggdrasil/drivers/tests/test_ModelDriver.py | leighmatth/yggdrasil | 5f7bdedf2e790026ddcc40e84ca0078ddcac8316 | [
"BSD-3-Clause"
] | null | null | null | yggdrasil/drivers/tests/test_ModelDriver.py | leighmatth/yggdrasil | 5f7bdedf2e790026ddcc40e84ca0078ddcac8316 | [
"BSD-3-Clause"
] | null | null | null | import os
import copy
import unittest
import pprint
import shutil
import logging
from yggdrasil import platform
from yggdrasil.tests import assert_raises, scripts, check_enabled_languages
from yggdrasil.drivers.ModelDriver import ModelDriver, remove_product
from yggdrasil.drivers.CompiledModelDriver import CompiledMode... | 45.848233 | 85 | 0.560785 | import os
import copy
import unittest
import pprint
import shutil
import logging
from yggdrasil import platform
from yggdrasil.tests import assert_raises, scripts, check_enabled_languages
from yggdrasil.drivers.ModelDriver import ModelDriver, remove_product
from yggdrasil.drivers.CompiledModelDriver import CompiledMode... | true | true |
08fb57f76cccb1b1da0726ff2787a6d4e70e7722 | 17,818 | py | Python | scripts/west_commands/run_common.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 1 | 2020-12-16T22:47:23.000Z | 2020-12-16T22:47:23.000Z | scripts/west_commands/run_common.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 2 | 2020-10-21T11:32:48.000Z | 2021-06-23T15:16:23.000Z | scripts/west_commands/run_common.py | Weining2019/zephyr | 0ccbe8ab6aedf100b9d31177e0b48eaa3d112e5c | [
"Apache-2.0"
] | 1 | 2022-02-02T04:48:37.000Z | 2022-02-02T04:48:37.000Z | # Copyright (c) 2018 Open Source Foundries Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Common code used by commands which execute runners.
'''
import argparse
import logging
from os import close, getcwd, path
from pathlib import Path
from subprocess import CalledProcessError
import sys
import tempfile
import ... | 37.19833 | 79 | 0.649624 |
import argparse
import logging
from os import close, getcwd, path
from pathlib import Path
from subprocess import CalledProcessError
import sys
import tempfile
import textwrap
import traceback
from west import log
from build_helpers import find_build_dir, is_zephyr_build, \
FIND_BUILD_DIR_DESCRIPTION
from west.c... | true | true |
08fb5841d411d1d14a4d22c08901f67d3d370cfc | 8,213 | py | Python | simpletransformers/language_generation/language_generation_model.py | rodrigogoulartsilva/simpletransformers | e9376b249652d1d172ccd80155943459e43435b1 | [
"Apache-2.0"
] | 1 | 2021-04-10T23:47:32.000Z | 2021-04-10T23:47:32.000Z | simpletransformers/language_generation/language_generation_model.py | rodrigogoulartsilva/simpletransformers | e9376b249652d1d172ccd80155943459e43435b1 | [
"Apache-2.0"
] | null | null | null | simpletransformers/language_generation/language_generation_model.py | rodrigogoulartsilva/simpletransformers | e9376b249652d1d172ccd80155943459e43435b1 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from transformers import (
CTRLConfig,
CTRLLMHeadModel,
CTRLTokenizer,
GPT2Config,
GPT2LMHeadModel,
GPT2Tokenizer,
OpenAIGPTConfig,
OpenAIGPTLMHeadModel,
OpenAIGPTTokenizer,
Transf... | 38.924171 | 194 | 0.657859 | import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from transformers import (
CTRLConfig,
CTRLLMHeadModel,
CTRLTokenizer,
GPT2Config,
GPT2LMHeadModel,
GPT2Tokenizer,
OpenAIGPTConfig,
OpenAIGPTLMHeadModel,
OpenAIGPTTokenizer,
Transf... | true | true |
08fb587ca541a92b121c14ac50560f9fb6a5ebbc | 220 | py | Python | 19_exponent_function.py | HeyItsFelipe/python_tutorial | aa989a0ead7d1a1637d5d93cc634a871e087c482 | [
"MIT"
] | null | null | null | 19_exponent_function.py | HeyItsFelipe/python_tutorial | aa989a0ead7d1a1637d5d93cc634a871e087c482 | [
"MIT"
] | null | null | null | 19_exponent_function.py | HeyItsFelipe/python_tutorial | aa989a0ead7d1a1637d5d93cc634a871e087c482 | [
"MIT"
] | null | null | null | ######## Exponent Function ########
print(2 ** 3)
def raise_to_power(base_num, pow_num):
result = 1
for index in range(pow_num):
result = result * base_num
return result
print(raise_to_power(3, 4)) | 20 | 38 | 0.622727 |
print(2 ** 3)
def raise_to_power(base_num, pow_num):
result = 1
for index in range(pow_num):
result = result * base_num
return result
print(raise_to_power(3, 4)) | true | true |
08fb58e5f0d8fdd3b331d307d589a5750ae03e13 | 18,029 | py | Python | cms/menu.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T10:28:46.000Z | 2019-04-15T10:28:46.000Z | cms/menu.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | null | null | null | cms/menu.py | samirasnoun/django_cms_gallery_image | 7792aa06a60877d86c022e73b60d0d669e79cb74 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
from django.contrib.sites.models import Site
from django.utils.translation import get_language
from cms.apphook_pool import apphook_pool
from cms.models.permissionmodels import ACCESS_DESCENDANTS
from cms.models.permissionmodels import ACCESS_PAGE_AND_DESCEN... | 39.10846 | 129 | 0.60081 | from collections import defaultdict
from django.contrib.sites.models import Site
from django.utils.translation import get_language
from cms.apphook_pool import apphook_pool
from cms.models.permissionmodels import ACCESS_DESCENDANTS
from cms.models.permissionmodels import ACCESS_PAGE_AND_DESCENDANTS
from cms.models.pe... | true | true |
08fb593d2d82a27d6fcfd91c1780bab3e5e466ef | 1,625 | py | Python | src/django/web/sid/helper/apiresponse.py | deshk04/sid | 288fbde961a09ec5640f340794741fd949148e37 | [
"MIT"
] | null | null | null | src/django/web/sid/helper/apiresponse.py | deshk04/sid | 288fbde961a09ec5640f340794741fd949148e37 | [
"MIT"
] | 1 | 2021-06-17T10:10:39.000Z | 2021-06-19T11:14:46.000Z | src/django/web/sid/helper/apiresponse.py | deshk04/sid | 288fbde961a09ec5640f340794741fd949148e37 | [
"MIT"
] | 1 | 2021-06-08T14:52:43.000Z | 2021-06-08T14:52:43.000Z | """
Description: Response class
"""
import json
from datetime import datetime, date
class ApiResponse():
"""
we need to output an standard json such that angular
always know what to expect
below is the format
{
status:
message:
num_of_recor... | 23.897059 | 71 | 0.533538 |
import json
from datetime import datetime, date
class ApiResponse():
def __init__(self, *args, **kwargs):
self.status = 'ok'
self.message = []
self.num_of_records = 0
self.records = None
def setrecords(self, result):
self.records = result
def updatecount(self):
... | true | true |
08fb59a3edb52c04051f3b82819ad0bf6f6bf9e2 | 4,158 | py | Python | txsocksx/http.py | lunay001/txsocksx-backup | 110f71d11704e6f9811701fd28424f400f8510b2 | [
"0BSD"
] | 53 | 2015-01-04T19:36:47.000Z | 2022-01-06T05:37:33.000Z | txsocksx/http.py | lunay001/txsocksx-backup | 110f71d11704e6f9811701fd28424f400f8510b2 | [
"0BSD"
] | 15 | 2015-02-03T11:16:43.000Z | 2022-02-03T18:26:11.000Z | txsocksx/http.py | lunay001/txsocksx-backup | 110f71d11704e6f9811701fd28424f400f8510b2 | [
"0BSD"
] | 31 | 2015-02-23T18:29:53.000Z | 2021-04-13T17:05:44.000Z | # Copyright (c) Aaron Gallagher <_@habnab.it>
# See COPYING for details.
"""``twisted.web.client`` adapters for SOCKS4/4a and SOCKS5 connections.
This requires Twisted 12.1 or greater to use.
"""
import twisted
from twisted.python.versions import Version
from twisted.web.client import Agent, SchemeNotSupported
fr... | 36.79646 | 97 | 0.692641 |
import twisted
from twisted.python.versions import Version
from twisted.web.client import Agent, SchemeNotSupported
from txsocksx.client import SOCKS4ClientEndpoint, SOCKS5ClientEndpoint
from txsocksx.tls import TLSWrapClientEndpoint
_twisted_12_1 = Version('twisted', 12, 1, 0)
_twisted_14_0 = Version('twisted', ... | true | true |
08fb5aa9b89568aa5b4c8fe067986dc56937833e | 555 | py | Python | pacote dawload/projetos progamas em Python/desafio18 Seno, Cosseno e Tangente.py | wagnersistemalima/Mundo-1-Python-Curso-em-Video | e8a1311eb73d675ab0d2d7286ca964485699125d | [
"MIT"
] | 1 | 2020-12-11T23:22:23.000Z | 2020-12-11T23:22:23.000Z | pacote dawload/projetos progamas em Python/desafio18 Seno, Cosseno e Tangente.py | wagnersistemalima/Mundo-1-Python-Curso-em-Video | e8a1311eb73d675ab0d2d7286ca964485699125d | [
"MIT"
] | null | null | null | pacote dawload/projetos progamas em Python/desafio18 Seno, Cosseno e Tangente.py | wagnersistemalima/Mundo-1-Python-Curso-em-Video | e8a1311eb73d675ab0d2d7286ca964485699125d | [
"MIT"
] | null | null | null | #desafio18) seno\ coseno \ tagente. faça um progama que leia um angulo qualquer e mostre na tela
# o valor do seno,
# cosseno e tangente desse angulo.
import math
entrada = float(input('Digite o valor do angulo: '))
seno = math.sin(math.radians(entrada))
print('O angulo de: {} tem o seno de: {}'.format(entrada, seno))
... | 46.25 | 96 | 0.713514 | import math
entrada = float(input('Digite o valor do angulo: '))
seno = math.sin(math.radians(entrada))
print('O angulo de: {} tem o seno de: {}'.format(entrada, seno))
cosseno = math.cos(math.radians(entrada))
print('O angulo de: {} Tem o cosseno de {:.2f}'.format(entrada, cosseno))
tangente = math.tan(math.radians(en... | true | true |
08fb5d96fec11693773194c36a49eede58ca9fc2 | 4,381 | py | Python | tests/test_tile_on_grid.py | Can-Zhao/MONAI | e29ef022b97a4e809dd22d4d208005f541ee061b | [
"Apache-2.0"
] | 3 | 2020-06-22T20:59:14.000Z | 2021-04-09T21:24:45.000Z | tests/test_tile_on_grid.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | null | null | null | tests/test_tile_on_grid.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | 1 | 2020-05-27T12:53:58.000Z | 2020-05-27T12:53:58.000Z | # Copyright (c) MONAI Consortium
# 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, so... | 30.852113 | 115 | 0.582972 |
import unittest
from typing import Optional
import numpy as np
from parameterized import parameterized
from monai.apps.pathology.transforms import TileOnGrid
from tests.utils import TEST_NDARRAYS, assert_allclose
TEST_CASES = []
for tile_count in [16, 64]:
for tile_size in [8, 32]:
for filter_mode in ["... | true | true |
08fb5dff239500823ff4dcc9ea88c2494ade30e4 | 95 | py | Python | about/admin.py | kirubarajan/old_site | db50c79fec37e494891f2361e1c75e8f834255ce | [
"MIT"
] | 1 | 2020-04-19T04:48:47.000Z | 2020-04-19T04:48:47.000Z | about/admin.py | kirubarajan/old_site | db50c79fec37e494891f2361e1c75e8f834255ce | [
"MIT"
] | 3 | 2020-02-11T23:11:11.000Z | 2021-06-10T20:48:38.000Z | about/admin.py | kirubarajan/old_site | db50c79fec37e494891f2361e1c75e8f834255ce | [
"MIT"
] | null | null | null | from django.contrib import admin
from about.models import Project
admin.site.register(Project) | 23.75 | 32 | 0.842105 | from django.contrib import admin
from about.models import Project
admin.site.register(Project) | true | true |
08fb5e000ea9cd0001db3659827ec7f048b1f626 | 186 | py | Python | newsfeed/constants.py | Freston2021/dfconfecciones | da1d62006aa958295159ae9fa58584c670ec83be | [
"MIT"
] | null | null | null | newsfeed/constants.py | Freston2021/dfconfecciones | da1d62006aa958295159ae9fa58584c670ec83be | [
"MIT"
] | null | null | null | newsfeed/constants.py | Freston2021/dfconfecciones | da1d62006aa958295159ae9fa58584c670ec83be | [
"MIT"
] | null | null | null | DAILY_ISSUE = 1
WEEKLY_ISSUE = 2
MONTHLY_ISSUE = 2
ISSUE_TYPE_CHOICES = (
(DAILY_ISSUE, 'Daily Issue'),
(WEEKLY_ISSUE, 'Weekly Issue'),
(MONTHLY_ISSUE, 'Monthly Issue'),
)
| 16.909091 | 37 | 0.677419 | DAILY_ISSUE = 1
WEEKLY_ISSUE = 2
MONTHLY_ISSUE = 2
ISSUE_TYPE_CHOICES = (
(DAILY_ISSUE, 'Daily Issue'),
(WEEKLY_ISSUE, 'Weekly Issue'),
(MONTHLY_ISSUE, 'Monthly Issue'),
)
| true | true |
08fb5e118d8c51f84ca213956a8a12cd50e45bfd | 406 | py | Python | postcodeinfo/apps/postcode_api/migrations/0003_populate_postcode_area.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | null | null | null | postcodeinfo/apps/postcode_api/migrations/0003_populate_postcode_area.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | null | null | null | postcodeinfo/apps/postcode_api/migrations/0003_populate_postcode_area.py | UKHomeOffice/postcodeinfo | f268a6b6d6d7ac55cb2fb307e98275348e30a287 | [
"MIT"
] | 1 | 2021-04-11T09:12:19.000Z | 2021-04-11T09:12:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('postcode_api', '0002_address_postcode_area'),
]
operations = [
migrations.RunSQL(
"UPDATE postcode_api_address "
... | 21.368421 | 55 | 0.6133 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('postcode_api', '0002_address_postcode_area'),
]
operations = [
migrations.RunSQL(
"UPDATE postcode_api_address "
"SET postcode_area ... | true | true |
08fb5f1dd00864bee074b5b73bf709c799bab480 | 222 | py | Python | landlab/plot/__init__.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 257 | 2015-01-13T16:01:21.000Z | 2022-03-29T22:37:43.000Z | landlab/plot/__init__.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 1,222 | 2015-02-05T21:36:53.000Z | 2022-03-31T17:53:49.000Z | landlab/plot/__init__.py | amanaster2/landlab | ea17f8314eb12e3fc76df66c9b6ff32078caa75c | [
"MIT"
] | 274 | 2015-02-11T19:56:08.000Z | 2022-03-28T23:31:07.000Z | from landlab.plot.imshow import imshow_grid, imshow_grid_at_node
from landlab.plot.network_sediment_transporter import plot_network_and_parcels
__all__ = ["imshow_grid", "imshow_grid_at_node", "plot_network_and_parcels"]
| 44.4 | 78 | 0.86036 | from landlab.plot.imshow import imshow_grid, imshow_grid_at_node
from landlab.plot.network_sediment_transporter import plot_network_and_parcels
__all__ = ["imshow_grid", "imshow_grid_at_node", "plot_network_and_parcels"]
| true | true |
08fb5f789188fcfedf9b84904d48752fa56cb94a | 2,426 | py | Python | tracing/tracing/value/diagnostics/related_name_map_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | tracing/tracing/value/diagnostics/related_name_map_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | tracing/tracing/value/diagnostics/related_name_map_unittest.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tracing.value import histogram_deserializer
from tracing.value import histogram_serializer
from tracing.value import histogram_unittest... | 35.15942 | 80 | 0.708574 |
import unittest
from tracing.value import histogram_deserializer
from tracing.value import histogram_serializer
from tracing.value import histogram_unittest
from tracing.value.diagnostics import diagnostic
from tracing.value.diagnostics import generic_set
from tracing.value.diagnostics import related_name_map
class... | true | true |
08fb5f861acc4aa023b533b437a3be9429f70ef2 | 2,592 | py | Python | tensorflow/python/training/training_util.py | 285219011/hello-world | dfb71ea206eb9f61e5d97c9727caa1a6449e39cb | [
"Apache-2.0"
] | 6 | 2017-04-25T01:30:41.000Z | 2019-12-11T15:08:46.000Z | tensorflow/python/training/training_util.py | PaulTR/tensorflow | 84bcff1e814ee5697b5980535583737f8e81d82f | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/training_util.py | PaulTR/tensorflow | 84bcff1e814ee5697b5980535583737f8e81d82f | [
"Apache-2.0"
] | 8 | 2017-04-17T23:39:12.000Z | 2019-05-11T14:06:31.000Z | # Copyright 2015 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... | 32.810127 | 80 | 0.715664 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path
from tensorflow.python import pywrap_tensorflow
def global_step(sess, global_step_tensor):
return int(sess.run(global_step_tensor))
def write_graph(graph_def, logdir, name, as_t... | true | true |
08fb602c0eae4cb43f996fa67d460a3831a99bc7 | 3,161 | py | Python | mysite/mysite/settings.py | dalonlobo/Django11Polls | 89e93dcec61274a46bbec10a872234512b113158 | [
"MIT"
] | null | null | null | mysite/mysite/settings.py | dalonlobo/Django11Polls | 89e93dcec61274a46bbec10a872234512b113158 | [
"MIT"
] | null | null | null | mysite/mysite/settings.py | dalonlobo/Django11Polls | 89e93dcec61274a46bbec10a872234512b113158 | [
"MIT"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
... | 25.909836 | 91 | 0.698197 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = ')40k4cly018(!0ts86xrq4glhvc70a7sf5trl6e&!ch9n-*u-+'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
08fb61580f062f3a2639bd9900194ee129008a91 | 3,919 | py | Python | tests/torch/quantization/test_serialize_to_json.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 310 | 2020-10-29T09:22:42.000Z | 2022-03-31T04:53:34.000Z | tests/torch/quantization/test_serialize_to_json.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 615 | 2020-10-28T10:22:25.000Z | 2022-03-29T18:09:23.000Z | tests/torch/quantization/test_serialize_to_json.py | MaximProshin/nncf | 2290d2f4cebcf6749e419dc76850e7bd8b7d8da1 | [
"Apache-2.0"
] | 86 | 2020-10-28T11:34:34.000Z | 2022-03-31T08:00:35.000Z | import json
import torch
from nncf.common.graph.transformations.commands import TargetType
from nncf.common.quantization.quantizer_setup import ActivationQuantizationInsertionPoint
from nncf.common.quantization.quantizer_setup import SingleConfigQuantizationPoint
from nncf.common.quantization.quantizer_setup import S... | 32.658333 | 114 | 0.660883 | import json
import torch
from nncf.common.graph.transformations.commands import TargetType
from nncf.common.quantization.quantizer_setup import ActivationQuantizationInsertionPoint
from nncf.common.quantization.quantizer_setup import SingleConfigQuantizationPoint
from nncf.common.quantization.quantizer_setup import S... | true | true |
08fb629b8d867703bf51707955e59a4ad358d465 | 5,423 | py | Python | nengo_spinnaker/utils/tests/test_fixpoint.py | ctn-archive/nengo_spinnaker_2014 | 2dcfe9506fedd9c4aebb66f5e1ba745d2f027871 | [
"MIT"
] | null | null | null | nengo_spinnaker/utils/tests/test_fixpoint.py | ctn-archive/nengo_spinnaker_2014 | 2dcfe9506fedd9c4aebb66f5e1ba745d2f027871 | [
"MIT"
] | 2 | 2015-06-15T19:51:15.000Z | 2015-12-16T16:25:39.000Z | nengo_spinnaker/utils/tests/test_fixpoint.py | ctn-archive/nengo_spinnaker_2014 | 2dcfe9506fedd9c4aebb66f5e1ba745d2f027871 | [
"MIT"
] | null | null | null | """Tests for the fixed-point utility module.
"""
import nengo
import pytest
from nengo_spinnaker.utils.fixpoint import *
def test_bitsk_basic():
assert bitsk(0.0) == 0
assert bitsk(1.0) == 0x8000
assert bitsk(2.0) == 0x10000
assert bitsk(0.5) == 0x4000
assert bitsk(2**16) == 0x7FFFFFFF
assert... | 33.475309 | 71 | 0.57754 |
import nengo
import pytest
from nengo_spinnaker.utils.fixpoint import *
def test_bitsk_basic():
assert bitsk(0.0) == 0
assert bitsk(1.0) == 0x8000
assert bitsk(2.0) == 0x10000
assert bitsk(0.5) == 0x4000
assert bitsk(2**16) == 0x7FFFFFFF
assert bitsk(-1.0) == 0x100000000 - 0x8000
assert b... | true | true |
08fb62da96e76146897332ca9155d7ade7e6167a | 9,606 | py | Python | test/test_endpoint.py | davschul/python-lsp-jsonrpc | 1c97c6da4778252b4e49f03ee6aba778b7e7092e | [
"MIT"
] | 13 | 2021-04-09T22:21:24.000Z | 2021-12-11T00:23:07.000Z | test/test_endpoint.py | davschul/python-lsp-jsonrpc | 1c97c6da4778252b4e49f03ee6aba778b7e7092e | [
"MIT"
] | 6 | 2021-04-14T21:01:41.000Z | 2022-02-16T13:03:52.000Z | test/test_endpoint.py | davschul/python-lsp-jsonrpc | 1c97c6da4778252b4e49f03ee6aba778b7e7092e | [
"MIT"
] | 8 | 2021-04-13T16:37:30.000Z | 2022-03-15T16:25:40.000Z | # Copyright 2018 Palantir Technologies, Inc.
# pylint: disable=redefined-outer-name
from concurrent import futures
import time
from unittest import mock
import pytest
from pylsp_jsonrpc import exceptions
from pylsp_jsonrpc.endpoint import Endpoint
MSG_ID = 'id'
@pytest.fixture()
def dispatcher():
return {}
@... | 28.170088 | 108 | 0.642411 |
from concurrent import futures
import time
from unittest import mock
import pytest
from pylsp_jsonrpc import exceptions
from pylsp_jsonrpc.endpoint import Endpoint
MSG_ID = 'id'
@pytest.fixture()
def dispatcher():
return {}
@pytest.fixture()
def consumer():
return mock.MagicMock()
@pytest.fixture()
def... | true | true |
08fb635c3e29e7dec6a22fa2157dd10315bea50e | 2,333 | py | Python | lib/googlecloudsdk/api_lib/sql/export_util.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/sql/export_util.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/sql/export_util.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.629032 | 79 | 0.73039 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def SqlExportContext(sql_messages, uri, database=None, table=None):
return sql_messages.ExportContext(
uri=uri,
databases=database or [],
fileType='SQL',
sqlExportOptions=sql_message... | true | true |
08fb63d4cfd97540f846f6e87c28afb203e3a7d1 | 93,357 | py | Python | spacy/language.py | rumeshmadhusanka/spaCy | 8bda39f088b1f0943ebd12f5ac425dcc74c4e5f0 | [
"MIT"
] | 1 | 2021-09-30T03:53:59.000Z | 2021-09-30T03:53:59.000Z | spacy/language.py | rumeshmadhusanka/spaCy | 8bda39f088b1f0943ebd12f5ac425dcc74c4e5f0 | [
"MIT"
] | null | null | null | spacy/language.py | rumeshmadhusanka/spaCy | 8bda39f088b1f0943ebd12f5ac425dcc74c4e5f0 | [
"MIT"
] | 2 | 2021-01-26T17:29:02.000Z | 2021-03-13T08:54:53.000Z | from typing import Iterator, Optional, Any, Dict, Callable, Iterable, TypeVar
from typing import Union, List, Pattern, overload
from typing import Tuple
from dataclasses import dataclass
import random
import itertools
import functools
from contextlib import contextmanager
from copy import deepcopy
from pathlib import P... | 43.482534 | 110 | 0.609071 | from typing import Iterator, Optional, Any, Dict, Callable, Iterable, TypeVar
from typing import Union, List, Pattern, overload
from typing import Tuple
from dataclasses import dataclass
import random
import itertools
import functools
from contextlib import contextmanager
from copy import deepcopy
from pathlib import P... | true | true |
08fb6431945bfbbbaf4944453f1464af9fa1e6d6 | 3,767 | py | Python | tce/Python-bindings/scripts/cfgTest.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 74 | 2015-10-22T15:34:10.000Z | 2022-03-25T07:57:23.000Z | tce/Python-bindings/scripts/cfgTest.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 79 | 2015-11-19T09:23:08.000Z | 2022-01-12T14:15:16.000Z | tce/Python-bindings/scripts/cfgTest.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 38 | 2015-11-17T10:12:23.000Z | 2022-03-25T07:57:24.000Z | #!/usr/bin/python3
# Copyright (c) 2002-2009 Tampere University.
#
# This file is part of TTA-Based Codesign Environment (TCE).
#
# 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 restr... | 44.317647 | 78 | 0.636846 | import TCE.base.program as prog
import TCE.base.mach as mach
import TCE.applibs.Scheduler.ProgramRepresentations.ControlFlowGraph as cfg
import TCE.base.osal as osal
import sys
def printOut(pr):
moveSum = 0
immediateSum = 0
instructionSum = 0
bypassSum = 0
blocks = 0
for i in range(pr.procedure... | true | true |
08fb647b723fe952755cfe071fc7ce071e630d7b | 8,069 | tac | Python | docs/core/howto/tutorial/listings/finger/finger21.tac | Khymeira/twisted | a8aae6853b729a742ed4a99b95e8fe0c5f1dad97 | [
"Unlicense",
"MIT"
] | 4,612 | 2015-01-01T12:57:23.000Z | 2022-03-30T01:08:23.000Z | docs/core/howto/tutorial/listings/finger/finger21.tac | Khymeira/twisted | a8aae6853b729a742ed4a99b95e8fe0c5f1dad97 | [
"Unlicense",
"MIT"
] | 1,243 | 2015-01-23T17:23:59.000Z | 2022-03-28T13:46:17.000Z | docs/core/howto/tutorial/listings/finger/finger21.tac | Khymeira/twisted | a8aae6853b729a742ed4a99b95e8fe0c5f1dad97 | [
"Unlicense",
"MIT"
] | 1,236 | 2015-01-13T14:41:26.000Z | 2022-03-17T07:12:36.000Z | # Do everything properly, and componentize
import cgi
from zope.interface import Interface, implementer
from twisted.application import internet, service, strports
from twisted.internet import defer, endpoints, protocol, reactor
from twisted.protocols import basic
from twisted.python import components
from twisted.sp... | 25.294671 | 84 | 0.64754 | import cgi
from zope.interface import Interface, implementer
from twisted.application import internet, service, strports
from twisted.internet import defer, endpoints, protocol, reactor
from twisted.protocols import basic
from twisted.python import components
from twisted.spread import pb
from twisted.web import reso... | true | true |
08fb64c192e87a460cae81f36e164dac64c4d5c0 | 22,347 | py | Python | leo/plugins/qt_events.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/qt_events.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/qt_events.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20140907103315.18766: * @file ../plugins/qt_events.py
#@@first
'''Leo's Qt event handling code.'''
#@+<< about internal bindings >>
#@+node:ekr.20110605121601.18538: ** << about internal bindings >>
#@@nocolor-node
#@+at
#
# Here are the rules for translating key b... | 39.205263 | 92 | 0.537343 | # rules.
#@-<< about internal bindings >>
import leo.core.leoGlobals as g
import leo.core.leoGui as leoGui
from leo.core.leoQt import QtCore, QtGui, QtWidgets
# import string
# import sys
#@+others
#@+node:ekr.20141028061518.17: ** class LeoQtEventFilter
class LeoQtEventFilter(QtCore.QObject):
#@+others
#@+node... | true | true |
08fb64cb0aba2360aba4ad2350b01eed77049849 | 1,752 | py | Python | configs/_base_/datasets/coco_detection.py | clintonjwang/mmdetection | f0d1aebdc162ab7e3748d7ac050b523476639818 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/coco_detection.py | clintonjwang/mmdetection | f0d1aebdc162ab7e3748d7ac050b523476639818 | [
"Apache-2.0"
] | 1 | 2021-12-01T04:15:47.000Z | 2021-12-01T04:15:47.000Z | configs/_base_/datasets/coco_detection.py | clintonjwang/mmdetection | f0d1aebdc162ab7e3748d7ac050b523476639818 | [
"Apache-2.0"
] | null | null | null | # dataset settings
dataset_type = 'CocoDataset'
data_root = '/data/vision/polina/scratch/clintonw/datasets/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
... | 35.04 | 77 | 0.632991 | dataset_type = 'CocoDataset'
data_root = '/data/vision/polina/scratch/clintonw/datasets/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(type='Resize... | true | true |
08fb660410ee76e2495edd349cca4475ad168e85 | 7,871 | py | Python | reconstruction/reconstruction_system/sensors/realsense_recorder.py | yutashx/PiSense | bc059e8e0bf17adafc116e10bd4a6a69b6d99cf1 | [
"MIT"
] | null | null | null | reconstruction/reconstruction_system/sensors/realsense_recorder.py | yutashx/PiSense | bc059e8e0bf17adafc116e10bd4a6a69b6d99cf1 | [
"MIT"
] | null | null | null | reconstruction/reconstruction_system/sensors/realsense_recorder.py | yutashx/PiSense | bc059e8e0bf17adafc116e10bd4a6a69b6d99cf1 | [
"MIT"
] | null | null | null | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/python/reconstruction_system/sensors/realsense_recorder.py
# pyrealsense2 is required.
# Please see instructions in https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python
import pyrea... | 38.024155 | 133 | 0.648202 |
import pyrealsense2 as rs
import numpy as np
import cv2
from os import makedirs
from os.path import exists, join
import shutil
import json
from enum import IntEnum
from argparse import ArgumentParser
try:
input = raw_input
except NameError:
pass
class Preset(IntEnum):
Custom = 0
Default = 1
... | true | true |
08fb66a0e4e3d9c09242808ecb98d3dab252ade3 | 1,621 | py | Python | init.py | iamtrask/PyAono | 4d847d7552dcee2c1e31727f37c4618ee7241896 | [
"Apache-2.0"
] | 2 | 2019-04-15T14:00:15.000Z | 2020-04-15T04:36:04.000Z | init.py | iamtrask/PyAono | 4d847d7552dcee2c1e31727f37c4618ee7241896 | [
"Apache-2.0"
] | null | null | null | init.py | iamtrask/PyAono | 4d847d7552dcee2c1e31727f37c4618ee7241896 | [
"Apache-2.0"
] | 2 | 2018-09-18T13:52:29.000Z | 2019-09-06T03:49:35.000Z | import Aono
from Aono import *
pari_init(2000000000, 2)
keys = key_gen()
keys = keys.generate_key(100, 64, 100, 8, 4, 7)
ct1 = ciphertext(create_message_matrix(4, 64), keys.pk, keys.pk.params)
ct2 = ciphertext(create_message_matrix(5, 64), keys.pk, keys.pk.params)
ct3 = ciphertext(create_message_matrix(6, 64), keys.p... | 31.784314 | 113 | 0.515114 | import Aono
from Aono import *
pari_init(2000000000, 2)
keys = key_gen()
keys = keys.generate_key(100, 64, 100, 8, 4, 7)
ct1 = ciphertext(create_message_matrix(4, 64), keys.pk, keys.pk.params)
ct2 = ciphertext(create_message_matrix(5, 64), keys.pk, keys.pk.params)
ct3 = ciphertext(create_message_matrix(6, 64), keys.p... | true | true |
08fb6727844b13d30c72d634079f1dd4d7392a3c | 1,616 | py | Python | taky/cli/__main__.py | fordepowers/taky | aba5ae504a84edce8eee4e266634d2e29c0fe76c | [
"MIT"
] | 46 | 2021-01-18T17:35:54.000Z | 2022-03-27T06:51:10.000Z | taky/cli/__main__.py | fordepowers/taky | aba5ae504a84edce8eee4e266634d2e29c0fe76c | [
"MIT"
] | 57 | 2021-02-20T00:39:45.000Z | 2022-03-30T09:41:44.000Z | taky/cli/__main__.py | fordepowers/taky | aba5ae504a84edce8eee4e266634d2e29c0fe76c | [
"MIT"
] | 18 | 2021-03-26T17:15:56.000Z | 2022-03-30T19:51:39.000Z | import sys
import argparse
import configparser
import traceback
from taky import __version__
from taky.config import load_config
from taky import cli
def arg_parse():
argp = argparse.ArgumentParser(description="Taky command line utility")
argp.add_argument(
"-c",
action="store",
dest=... | 22.444444 | 83 | 0.621906 | import sys
import argparse
import configparser
import traceback
from taky import __version__
from taky.config import load_config
from taky import cli
def arg_parse():
argp = argparse.ArgumentParser(description="Taky command line utility")
argp.add_argument(
"-c",
action="store",
dest=... | true | true |
08fb6783a5d35d068fe9e47ee481dd88d120959c | 2,037 | py | Python | trading_calendars/calendar_helpers.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 508 | 2018-06-27T05:50:30.000Z | 2022-03-31T09:08:49.000Z | trading_calendars/calendar_helpers.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 149 | 2018-06-21T22:20:49.000Z | 2022-03-30T23:05:15.000Z | trading_calendars/calendar_helpers.py | sjquant/trading_calendars | 9407809a4447da0bf8920f4100496c4d4834185b | [
"Apache-2.0"
] | 243 | 2018-07-10T06:49:21.000Z | 2022-03-03T03:57:44.000Z | import numpy as np
import pandas as pd
NANOSECONDS_PER_MINUTE = int(6e10)
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
def next_divider_idx(dividers, minute_val):
divider_idx = np.searchsorted(dividers, minute_val, side="right")
target = dividers[divider_idx]
if minute_val == target:
# if dt... | 28.690141 | 75 | 0.600393 | import numpy as np
import pandas as pd
NANOSECONDS_PER_MINUTE = int(6e10)
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
def next_divider_idx(dividers, minute_val):
divider_idx = np.searchsorted(dividers, minute_val, side="right")
target = dividers[divider_idx]
if minute_val == target:
... | true | true |
08fb684aff3b69b7153322adf5766706f5dc70f6 | 4,615 | py | Python | data/p3BR/R2/benchmark/startCirq371.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq371.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq371.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=74
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 41.576577 | 77 | 0.682774 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0])) c.append(cirq.H.on(input_qubit[2])) c.append(c... | true | true |
08fb6a3db46673f34be2a616a3207c28d7916814 | 476 | py | Python | cgine/main/forms.py | abdullahMosibah/cgine | 9543e2511751cee1e6f1cbdfd97dae2d97e05cc9 | [
"MIT"
] | 1 | 2021-12-16T11:15:38.000Z | 2021-12-16T11:15:38.000Z | cgine/main/forms.py | abdullahMosibah/cgine | 9543e2511751cee1e6f1cbdfd97dae2d97e05cc9 | [
"MIT"
] | 4 | 2021-11-03T14:58:45.000Z | 2022-03-31T05:11:33.000Z | cgine/main/forms.py | abdullahMosibah/cgine | 9543e2511751cee1e6f1cbdfd97dae2d97e05cc9 | [
"MIT"
] | null | null | null | from django import forms
from .models import lesson, knowledge_block
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
class lesson_form(forms.ModelForm):
class Meta:
model = lesson
fields = ["title", "description", "category", "status"]
'''
'''
class knowledge_b... | 23.8 | 79 | 0.689076 | from django import forms
from .models import lesson, knowledge_block
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
class lesson_form(forms.ModelForm):
class Meta:
model = lesson
fields = ["title", "description", "category", "status"]
class knowledge_block_form(... | true | true |
08fb6a46f3e9cc18397642d6c593327c2055e74b | 2,138 | py | Python | copyspecial/copyspecial.py | febinstephen/google-python-class | 6eff4de15d58c88ca583b19d66bd5ac31d1bdb7c | [
"Apache-2.0"
] | null | null | null | copyspecial/copyspecial.py | febinstephen/google-python-class | 6eff4de15d58c88ca583b19d66bd5ac31d1bdb7c | [
"Apache-2.0"
] | null | null | null | copyspecial/copyspecial.py | febinstephen/google-python-class | 6eff4de15d58c88ca583b19d66bd5ac31d1bdb7c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
de... | 24.295455 | 79 | 0.645931 |
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
def get_special_paths(dirname):
special_paths = []
files = os.listdir(dirname)
for fname in files:
special_match = re.search(r'_(\w+)_',fname)
... | false | true |
08fb6ad417043ee49cc19096cb82370cc9594d50 | 2,815 | py | Python | tensorflow/contrib/learn/python/learn/ops/dnn_ops.py | 285219011/hello-world | dfb71ea206eb9f61e5d97c9727caa1a6449e39cb | [
"Apache-2.0"
] | 6 | 2017-04-25T01:30:41.000Z | 2019-12-11T15:08:46.000Z | tensorflow/contrib/learn/python/learn/ops/dnn_ops.py | PaulTR/tensorflow | 84bcff1e814ee5697b5980535583737f8e81d82f | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/ops/dnn_ops.py | PaulTR/tensorflow | 84bcff1e814ee5697b5980535583737f8e81d82f | [
"Apache-2.0"
] | 4 | 2017-04-14T07:31:18.000Z | 2021-08-30T11:06:24.000Z | # Copyright 2016 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... | 40.797101 | 80 | 0.710835 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import layers
from tensorflow.contrib.learn.python.learn.ops import dropout_ops
from tensorflow.python.framework import ops
from tensorflow.python.platform import tf_logging as loggin... | true | true |
08fb6b02e9bbc3576d87b80936d33cfa38b7cb0a | 2,082 | py | Python | objects/node.py | kex5n/Vehicles-Dispatch-Simulator | d0cca03fbf56e4b0ceeef8dafc59de105c1d4507 | [
"MIT"
] | null | null | null | objects/node.py | kex5n/Vehicles-Dispatch-Simulator | d0cca03fbf56e4b0ceeef8dafc59de105c1d4507 | [
"MIT"
] | null | null | null | objects/node.py | kex5n/Vehicles-Dispatch-Simulator | d0cca03fbf56e4b0ceeef8dafc59de105c1d4507 | [
"MIT"
] | null | null | null | from typing import Any, List
import numpy as np
import pandas as pd
# random.seed(1234)
np.random.seed(1234)
# torch.manual_seed(1234)
# torch.cuda.manual_seed_all(1234)
# torch.backends.cudnn.deterministic = True
class Node:
def __init__(self, id: int, node_index: int,longitude: float, latitude: float):
... | 28.520548 | 83 | 0.607589 | from typing import Any, List
import numpy as np
import pandas as pd
np.random.seed(1234)
class Node:
def __init__(self, id: int, node_index: int,longitude: float, latitude: float):
self.id: int = id
self.node_index: int = node_index
self.longitude: float = longitude
self.latitude... | true | true |
08fb6b2b06ad5835c2642317ea2d334959590406 | 31,548 | py | Python | synapse/rest/client/v2_alpha/groups.py | rkfg/synapse | 0b3112123da5fae4964db784e3bab0c4d83d9d62 | [
"Apache-2.0"
] | 1 | 2021-03-29T22:47:31.000Z | 2021-03-29T22:47:31.000Z | synapse/rest/client/v2_alpha/groups.py | rkfg/synapse | 0b3112123da5fae4964db784e3bab0c4d83d9d62 | [
"Apache-2.0"
] | 1 | 2019-04-04T05:08:04.000Z | 2019-04-04T05:08:04.000Z | synapse/rest/client/v2_alpha/groups.py | f35f0ef9d0e827dae86552d3899f78fc/synapse | 7b76a6f597b840a2db333682e52edf2c19f09994 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 Vector Creations Ltd
# Copyright 2018 New Vector 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.... | 32.896767 | 88 | 0.65795 |
import logging
from functools import wraps
from typing import TYPE_CHECKING, Optional, Tuple
from twisted.web.server import Request
from synapse.api.constants import (
MAX_GROUP_CATEGORYID_LENGTH,
MAX_GROUP_ROLEID_LENGTH,
MAX_GROUPID_LENGTH,
)
from synapse.api.errors import Codes, SynapseError
from synap... | true | true |
08fb6b4256a3de248a1ea74825a4e4ad667552a4 | 28,969 | py | Python | kernel_tuner/interface.py | jiskattema/kernel_tuner | dacd79e3371308092798f7f2394a5d20af8bdebd | [
"Apache-2.0"
] | null | null | null | kernel_tuner/interface.py | jiskattema/kernel_tuner | dacd79e3371308092798f7f2394a5d20af8bdebd | [
"Apache-2.0"
] | null | null | null | kernel_tuner/interface.py | jiskattema/kernel_tuner | dacd79e3371308092798f7f2394a5d20af8bdebd | [
"Apache-2.0"
] | null | null | null | """Kernel Tuner interface module
This module contains the main functions that Kernel Tuner
offers to its users.
Author
------
Ben van Werkhoven <b.vanwerkhoven@esciencenter.nl>
Copyright and License
---------------------
* Copyright 2016 Netherlands eScience Center
Licensed under the Apache License, Version 2.0 (th... | 49.689537 | 171 | 0.659567 | from __future__ import print_function
import json
import os.path
from collections import OrderedDict
import importlib
from datetime import datetime
import logging
import sys
import numpy
import kernel_tuner.util as util
import kernel_tuner.core as core
from kernel_tuner.runners.sequential import SequentialRunner
fro... | true | true |
08fb6bcf401122a4606c64d98a3049881878d200 | 1,843 | py | Python | app/user/serializers.py | J0shu4B0y/research-drf-app | 503eea6a17ba107438490f0c24cc1fb6e5e6051c | [
"MIT"
] | null | null | null | app/user/serializers.py | J0shu4B0y/research-drf-app | 503eea6a17ba107438490f0c24cc1fb6e5e6051c | [
"MIT"
] | null | null | null | app/user/serializers.py | J0shu4B0y/research-drf-app | 503eea6a17ba107438490f0c24cc1fb6e5e6051c | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""Serializer for the users object"""
class Meta:
model = get_user_model()
fields = (... | 28.796875 | 73 | 0.604449 | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = (
'email',
'passwor... | true | true |
08fb6d4a746e819ed5c3446e7f94e50a950ff840 | 3,299 | py | Python | tests/views/test_error_code.py | SmallCream/django-cool | 63b136da7ce39135c9f900e8161288f8fc8893a4 | [
"BSD-3-Clause"
] | null | null | null | tests/views/test_error_code.py | SmallCream/django-cool | 63b136da7ce39135c9f900e8161288f8fc8893a4 | [
"BSD-3-Clause"
] | null | null | null | tests/views/test_error_code.py | SmallCream/django-cool | 63b136da7ce39135c9f900e8161288f8fc8893a4 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
from django.test import TestCase, override_settings
def get_error_code():
import importlib
from cool.views import error_code
importlib.reload(error_code)
return error_code
class ErrorCodeTests(TestCase):
def test_error_code(self):
error_code = get_error_code()
... | 47.811594 | 94 | 0.735677 |
from django.test import TestCase, override_settings
def get_error_code():
import importlib
from cool.views import error_code
importlib.reload(error_code)
return error_code
class ErrorCodeTests(TestCase):
def test_error_code(self):
error_code = get_error_code()
self.assertEqual... | true | true |
08fb6e2250a3667395abea7631d0bc8e945bba46 | 7,921 | py | Python | ASoP1_Spectral/ASoP1_spectral_main.py | gillmmartin/ASoP1-Spectral | af9abbfd6d18b5b99aedb4343fadad4816319710 | [
"Apache-2.0"
] | null | null | null | ASoP1_Spectral/ASoP1_spectral_main.py | gillmmartin/ASoP1-Spectral | af9abbfd6d18b5b99aedb4343fadad4816319710 | [
"Apache-2.0"
] | null | null | null | ASoP1_Spectral/ASoP1_spectral_main.py | gillmmartin/ASoP1-Spectral | af9abbfd6d18b5b99aedb4343fadad4816319710 | [
"Apache-2.0"
] | 1 | 2022-02-21T06:35:51.000Z | 2022-02-21T06:35:51.000Z | # (C) British Crown Copyright 2016, Met Office.
"""
Main function to show how to use the code package to process
two model precipitation datasets and compare them with each
other and with two observational datasets.
These could be from different data sources or different timescales
or spatial resolutions of the same d... | 36.502304 | 108 | 0.718344 | """
Main function to show how to use the code package to process
two model precipitation datasets and compare them with each
other and with two observational datasets.
These could be from different data sources or different timescales
or spatial resolutions of the same data source.
Author: Gill Martin
"""
import iri... | false | true |
08fb6e368b69f1f0dbd98360b26ec81e1cc2cb39 | 3,454 | py | Python | app/main_req_handler.py | vpn41/vpn41 | e56f3ed6525d15ccbf03a2bbcc2dd6c5bbbd8bfd | [
"MIT"
] | 2 | 2021-12-26T11:10:54.000Z | 2022-01-27T22:13:30.000Z | app/main_req_handler.py | vpn41/vpn41 | e56f3ed6525d15ccbf03a2bbcc2dd6c5bbbd8bfd | [
"MIT"
] | null | null | null | app/main_req_handler.py | vpn41/vpn41 | e56f3ed6525d15ccbf03a2bbcc2dd6c5bbbd8bfd | [
"MIT"
] | null | null | null | import json
import flask
from flask import url_for, request, session, redirect, render_template
from werkzeug.exceptions import MethodNotAllowed, NotFound, BadRequest, NotAcceptable
import settings
import validator as v
from setup_processors_pool import AlreadyInProgressError
from aux_stuff import *
class MainReque... | 33.211538 | 116 | 0.605096 | import json
import flask
from flask import url_for, request, session, redirect, render_template
from werkzeug.exceptions import MethodNotAllowed, NotFound, BadRequest, NotAcceptable
import settings
import validator as v
from setup_processors_pool import AlreadyInProgressError
from aux_stuff import *
class MainReque... | true | true |
08fb6e53e7ba53e647d391792f348c6a91b8c94b | 3,081 | py | Python | tests/integration/test_azure_blob_storage_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 4 | 2020-01-02T01:52:17.000Z | 2020-06-15T13:10:37.000Z | tests/integration/test_azure_blob_storage_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3 | 2021-12-13T14:45:52.000Z | 2021-12-20T21:01:10.000Z | tests/integration/test_azure_blob_storage_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 1 | 2022-03-17T13:23:06.000Z | 2022-03-17T13:23:06.000Z | import logging
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
NODE1 = "node1"
NODE2 = "node2"
TABLE_NAME = "blob_storage_table"
CONTAINER_NAME = "cont"
CLUSTER_NAME = "test_cluster"
@pytest.fixture(scope... | 36.678571 | 112 | 0.674456 | import logging
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
NODE1 = "node1"
NODE2 = "node2"
TABLE_NAME = "blob_storage_table"
CONTAINER_NAME = "cont"
CLUSTER_NAME = "test_cluster"
@pytest.fixture(scope... | true | true |
08fb6e77fc12845ac886859e97c127ccc642df15 | 495 | py | Python | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.py | navneetvermanav/75-days-challenges-with-TM | 84ebf3aafda34fa5b67cac2f6be75cb69404710c | [
"MIT"
] | null | null | null | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.py | navneetvermanav/75-days-challenges-with-TM | 84ebf3aafda34fa5b67cac2f6be75cb69404710c | [
"MIT"
] | null | null | null | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.py | navneetvermanav/75-days-challenges-with-TM | 84ebf3aafda34fa5b67cac2f6be75cb69404710c | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def searchBST(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]:
pos = root
wh... | 30.9375 | 82 | 0.539394 | class Solution:
def searchBST(self, root: Optional[TreeNode], val: int) -> Optional[TreeNode]:
pos = root
while pos:
if val > pos.val: pos = pos.right
elif val < pos.val: pos = pos.left
else:
return pos
return None
| true | true |
08fb701885c55ca23d7bb856669feede1c1b5eeb | 957 | py | Python | goal_tracker_django/contrib/sites/migrations/0002_set_site_domain_and_name.py | giantryansaul/goal_tracker_django | 2824a313bfb01b56b470ff6a0fdd469c82156cf7 | [
"BSD-3-Clause"
] | null | null | null | goal_tracker_django/contrib/sites/migrations/0002_set_site_domain_and_name.py | giantryansaul/goal_tracker_django | 2824a313bfb01b56b470ff6a0fdd469c82156cf7 | [
"BSD-3-Clause"
] | null | null | null | goal_tracker_django/contrib/sites/migrations/0002_set_site_domain_and_name.py | giantryansaul/goal_tracker_django | 2824a313bfb01b56b470ff6a0fdd469c82156cf7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID... | 23.341463 | 72 | 0.62069 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
"domain": "giantryansaul.ne... | true | true |
08fb702d01918ad440e120a00b16d75c90f49205 | 1,619 | py | Python | datapro/map.py | salmon-buck/salmon-buck-web | 465f8ca3fbff8578814a2a95a39d83dfd32749d7 | [
"MIT"
] | null | null | null | datapro/map.py | salmon-buck/salmon-buck-web | 465f8ca3fbff8578814a2a95a39d83dfd32749d7 | [
"MIT"
] | 8 | 2020-02-12T00:32:57.000Z | 2022-02-10T11:30:16.000Z | datapro/map.py | salmon-buck/salmon-buck-web | 465f8ca3fbff8578814a2a95a39d83dfd32749d7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import numpy as np
from sklearn.metrics import average_precision_score
# In[47]:
# query
def mAP(query, answer):
#truth = np.zeros((5))
count = 0
acc_num = 0
ap = 0
for i in range(5):
count += 1
if query[i] in answer:
... | 36.795455 | 780 | 0.680049 |
import numpy as np
from sklearn.metrics import average_precision_score
def mAP(query, answer):
count = 0
acc_num = 0
ap = 0
for i in range(5):
count += 1
if query[i] in answer:
acc_num += 1
ap += acc_num / count
ap /= 5
re... | true | true |
08fb70a4f30e74031681dccd078351dacd0d43c6 | 2,821 | py | Python | setup.py | luke-falvey/pipelinewise | 6aa8fd167002449f74696bd86abf3ccd950e0fcf | [
"Apache-2.0"
] | null | null | null | setup.py | luke-falvey/pipelinewise | 6aa8fd167002449f74696bd86abf3ccd950e0fcf | [
"Apache-2.0"
] | null | null | null | setup.py | luke-falvey/pipelinewise | 6aa8fd167002449f74696bd86abf3ccd950e0fcf | [
"Apache-2.0"
] | 1 | 2020-10-13T18:34:14.000Z | 2020-10-13T18:34:14.000Z | #!/usr/bin/env python
from setuptools import find_packages, setup
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
setup(name='pipelinewise',
version='0.24.1',
description='PipelineWise',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
autho... | 36.166667 | 87 | 0.556895 |
from setuptools import find_packages, setup
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
setup(name='pipelinewise',
version='0.24.1',
description='PipelineWise',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
author='TransferWise',
... | true | true |
08fb725b757f12ede1f5f82a28d386f3903c0b52 | 356 | py | Python | agents/base_algo_v2.py | DanIulian/minigrid_rl | d7b59fd1d1e62fc99d5134c89f59c6ad16246cfa | [
"MIT"
] | null | null | null | agents/base_algo_v2.py | DanIulian/minigrid_rl | d7b59fd1d1e62fc99d5134c89f59c6ad16246cfa | [
"MIT"
] | null | null | null | agents/base_algo_v2.py | DanIulian/minigrid_rl | d7b59fd1d1e62fc99d5134c89f59c6ad16246cfa | [
"MIT"
] | null | null | null | # AndreiN, 2019
from agents.base import BaseAlgo
from abc import abstractmethod
class BaseAlgov2(BaseAlgo):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@abstractmethod
def update_parameters(self):
raise NotImplemented
@abstractmethod
def get_save_data(... | 19.777778 | 41 | 0.69382 |
from agents.base import BaseAlgo
from abc import abstractmethod
class BaseAlgov2(BaseAlgo):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@abstractmethod
def update_parameters(self):
raise NotImplemented
@abstractmethod
def get_save_data(self):
r... | true | true |
08fb72d603e738a0c2e8c59a948492196ddf75b9 | 2,558 | py | Python | Mega_detector_raccoon_transfer_learning/log_files/parse_logs_to_csv.py | alnah005/raccoon_identification | 1af1213b744e061bd6f5551b7f76585115f94b03 | [
"MIT"
] | null | null | null | Mega_detector_raccoon_transfer_learning/log_files/parse_logs_to_csv.py | alnah005/raccoon_identification | 1af1213b744e061bd6f5551b7f76585115f94b03 | [
"MIT"
] | null | null | null | Mega_detector_raccoon_transfer_learning/log_files/parse_logs_to_csv.py | alnah005/raccoon_identification | 1af1213b744e061bd6f5551b7f76585115f94b03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
file: parse_logs_to_csv.py
@author: Suhail.Alnahari
@description:
@created: 2021-03-01T13:30:00.015Z-06:00
@last-modified: 2021-03-02T19:24:22.570Z-06:00
"""
# standard library
import re
# 3rd party packages
import pandas as pd
import numpy as np
# local source
# columns = ["Step",... | 58.136364 | 1,195 | 0.655981 |
import re
import pandas as pd
import numpy as np
columns = ["loss","step"]
regex = r"INFO:tensorflow:loss = (.*), step = (.*) \("
filenames = ["slurm-1160281.out","slurm-1178608.out"]
outputFile = "loss_result.csv"
filetext = ""
for i in filenames:
textfile = open(i, 'r')
filetext += textfile.read()
... | true | true |
08fb7448ff81778c4951a7192dd2cc499012ddf4 | 421 | py | Python | hmda/api.py | grapesmoker/data_api | f8cfb39bf4a37d00a892d5826f1662711d8c62dc | [
"MIT"
] | null | null | null | hmda/api.py | grapesmoker/data_api | f8cfb39bf4a37d00a892d5826f1662711d8c62dc | [
"MIT"
] | null | null | null | hmda/api.py | grapesmoker/data_api | f8cfb39bf4a37d00a892d5826f1662711d8c62dc | [
"MIT"
] | null | null | null | from tastypie.resources import ModelResource
from hmda.models import LoanApplicationRecord, Institution
class LARResource(ModelResource):
class Meta:
queryset = LoanApplicationRecord.objects.all()
resource_name = 'lar'
limit = 0
class InstitutionResource(ModelResource):
class Meta:... | 23.388889 | 58 | 0.703088 | from tastypie.resources import ModelResource
from hmda.models import LoanApplicationRecord, Institution
class LARResource(ModelResource):
class Meta:
queryset = LoanApplicationRecord.objects.all()
resource_name = 'lar'
limit = 0
class InstitutionResource(ModelResource):
class Meta:... | true | true |
08fb75a38c26634aba63aaa020e822acecb21c8f | 3,185 | py | Python | recipes/xsimd/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/xsimd/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | 1 | 2022-03-09T06:33:41.000Z | 2022-03-09T06:33:41.000Z | recipes/xsimd/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | null | null | null | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
import textwrap
required_conan_version = ">=1.43.0"
class XsimdConan(ConanFile):
name = "xsimd"
license = "BSD-3-Clause"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.... | 37.470588 | 140 | 0.651177 | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
import textwrap
required_conan_version = ">=1.43.0"
class XsimdConan(ConanFile):
name = "xsimd"
license = "BSD-3-Clause"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.... | true | true |
08fb75d9f6f8a9af2f61519b271367b1d0272253 | 431 | py | Python | producthunt/urls.py | collinsjumaz/Product-Hunt | 7c2ca34bb8826d513bb8242c459026a96c493c6c | [
"MIT"
] | null | null | null | producthunt/urls.py | collinsjumaz/Product-Hunt | 7c2ca34bb8826d513bb8242c459026a96c493c6c | [
"MIT"
] | 4 | 2020-06-05T21:01:42.000Z | 2021-06-10T21:30:37.000Z | producthunt/urls.py | collinsjumaz/Product-Hunt | 7c2ca34bb8826d513bb8242c459026a96c493c6c | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from products import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.home, name='home'),
path('accounts/', include('accounts.urls')),
... | 33.153846 | 65 | 0.733179 | from django.contrib import admin
from django.urls import path, include
from products import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.home, name='home'),
path('accounts/', include('accounts.urls')),
... | true | true |
08fb75fb02f626dc4e76c97a50b9c774f42c534b | 797 | py | Python | principal_app/models.py | RandyDpoe45/WhatsMusic | e1cf1b9a804acc2c4f928bd746db0c59c3f4ccc7 | [
"MIT"
] | null | null | null | principal_app/models.py | RandyDpoe45/WhatsMusic | e1cf1b9a804acc2c4f928bd746db0c59c3f4ccc7 | [
"MIT"
] | null | null | null | principal_app/models.py | RandyDpoe45/WhatsMusic | e1cf1b9a804acc2c4f928bd746db0c59c3f4ccc7 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Usuario(models.Model):
id_usuario = models.AutoField(primary_key=True)
nombre_usuario = models.CharField(max_length=30, unique= True)
nombre = models.CharField(max_length=50)
apellidos= models.CharField(max_length=50)
correo_electronico... | 36.227273 | 69 | 0.766625 | from django.db import models
class Usuario(models.Model):
id_usuario = models.AutoField(primary_key=True)
nombre_usuario = models.CharField(max_length=30, unique= True)
nombre = models.CharField(max_length=50)
apellidos= models.CharField(max_length=50)
correo_electronico= models.CharField(max_leng... | true | true |
08fb75ff57104ba0e016be0b26cee0bfa432f6ae | 2,569 | py | Python | scraper.py | furkansimsekli/HUBMB-Announcements-Bot | 91e37add06b44561e40e070ca23fd700319d5c07 | [
"MIT"
] | null | null | null | scraper.py | furkansimsekli/HUBMB-Announcements-Bot | 91e37add06b44561e40e070ca23fd700319d5c07 | [
"MIT"
] | null | null | null | scraper.py | furkansimsekli/HUBMB-Announcements-Bot | 91e37add06b44561e40e070ca23fd700319d5c07 | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
from bs4 import BeautifulSoup
import requests
import json
import os
load_dotenv()
announcementsURL = "http://cs.hacettepe.edu.tr/json/announcements.json"
def getPage(url):
try:
html = requests.get(url)
return html
except requests.exceptions.ConnectionError:
... | 24.466667 | 115 | 0.631763 | from dotenv import load_dotenv
from bs4 import BeautifulSoup
import requests
import json
import os
load_dotenv()
announcementsURL = "http://cs.hacettepe.edu.tr/json/announcements.json"
def getPage(url):
try:
html = requests.get(url)
return html
except requests.exceptions.ConnectionError:
... | true | true |
08fb765f17e8ad5e181e17c1d2b0c0c927cf60e6 | 1,184 | py | Python | source/pic2card/commands/generate_card.py | SidGulatiMsft/AdaptiveCards | 49562a904a3fce94a50b94a015d986d18328e4f3 | [
"MIT"
] | 743 | 2019-05-07T10:41:14.000Z | 2022-03-30T05:04:10.000Z | source/pic2card/commands/generate_card.py | SidGulatiMsft/AdaptiveCards | 49562a904a3fce94a50b94a015d986d18328e4f3 | [
"MIT"
] | 4,084 | 2019-05-07T18:04:03.000Z | 2022-03-31T23:27:45.000Z | source/pic2card/commands/generate_card.py | SidGulatiMsft/AdaptiveCards | 49562a904a3fce94a50b94a015d986d18328e4f3 | [
"MIT"
] | 320 | 2019-05-08T01:25:07.000Z | 2022-03-29T20:34:13.000Z | """
Command to predict the adaptive card json
Usage :
python -m command.generate_card --image_path=/path/to/input/image
"""
import argparse
import json
from PIL import Image
from mystique.predict_card import PredictCard
from mystique.utils import load_od_instance
def main(image_path=None, card_format=None):
"""... | 28.190476 | 79 | 0.697635 | import argparse
import json
from PIL import Image
from mystique.predict_card import PredictCard
from mystique.utils import load_od_instance
def main(image_path=None, card_format=None):
image = Image.open(image_path)
object_detection = load_od_instance()
card_json = PredictCard(object_detection).main(
... | true | true |
08fb76a0392d23d8d52cf6bb0185216443989619 | 1,301 | py | Python | postprocess/convert_contig_GIs.py | icelu/GI_Cluster | 03615af174a23e219a3aaa4909eee4d87074a09f | [
"MIT"
] | 3 | 2019-11-22T13:56:27.000Z | 2021-09-04T14:23:15.000Z | postprocess/convert_contig_GIs.py | icelu/GI_Cluster | 03615af174a23e219a3aaa4909eee4d87074a09f | [
"MIT"
] | 1 | 2018-12-19T10:16:48.000Z | 2018-12-20T11:41:31.000Z | postprocess/convert_contig_GIs.py | icelu/GI_Cluster | 03615af174a23e219a3aaa4909eee4d87074a09f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This script is used to convert the GIs predicted from contigs
#
# Author: Bingxin Lu
# Affiliation : National University of Singapore
# E-mail : bingxin@comp.nus.edu.sg
#
# Input:
# id_start id_end
#
# Output:
# id start end size
#
import optparse
import sys, os
parentdir = os.path.dirname(os... | 30.255814 | 118 | 0.678709 |
import optparse
import sys, os
parentdir = os.path.dirname(os.path.dirname(sys.argv[0]))
sys.path.insert(0, parentdir)
from util.parse_sequence import get_contig_IDs_rev
from util.interval_operations import get_intervals_contigs
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_optio... | true | true |
08fb76e04cc1dad3b226c4f4897e716752549748 | 3,019 | py | Python | spider.py | ginward/LykkeSpider | 9e4ade857a4525294fe4d04a9ff61485f17a5e84 | [
"MIT"
] | null | null | null | spider.py | ginward/LykkeSpider | 9e4ade857a4525294fe4d04a9ff61485f17a5e84 | [
"MIT"
] | null | null | null | spider.py | ginward/LykkeSpider | 9e4ade857a4525294fe4d04a9ff61485f17a5e84 | [
"MIT"
] | null | null | null | '''
The file to extract trade log data from lykke
Author: Jinhua Wang
University of Toronto
Feburary, 2017
MIT License
Copyright (c) 2017 Jinhua Wang
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 Softw... | 32.462366 | 85 | 0.727724 | '''
The file to extract trade log data from lykke
Author: Jinhua Wang
University of Toronto
Feburary, 2017
MIT License
Copyright (c) 2017 Jinhua Wang
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 Softw... | false | true |
08fb7829f3b5b3ad1185cd44ce200eef570899db | 2,092 | py | Python | oldnumba/tests/test_overflow.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | 1 | 2015-01-29T06:52:36.000Z | 2015-01-29T06:52:36.000Z | oldnumba/tests/test_overflow.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | oldnumba/tests/test_overflow.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | """
>>> native_convert(char, -10)
-10
>>> native_convert(char, 10)
10
>>> native_convert(char, 127)
127
This doesn't work yet, we should get an error here. We don't get one because
autojit detects the int type which is natively truncated to a char.
TODO::::::::::
>> native_convert(char, 128)
=> need exc... | 26.481013 | 76 | 0.662524 |
import unittest
from numba import *
@autojit
def native_convert(dst_type, value):
return dst_type(value)
@autojit(locals=dict(obj=object_))
def object_convert(dst_type, obj):
return dst_type(obj)
class TestConversion(unittest.TestCase):
def test_native_conversion(self):
assert native_convert(ch... | true | true |
08fb79490389c0ae59ab8c677759d277ea22a3a1 | 11,523 | py | Python | model_generation/gpt2.py | sagek21/swift-coreml-transformers | 02228fbd905ffc1cebfad31b73de19dd1bd34969 | [
"Apache-2.0"
] | 1 | 2019-09-15T04:40:13.000Z | 2019-09-15T04:40:13.000Z | model_generation/gpt2.py | sagek21/swift-coreml-transformers | 02228fbd905ffc1cebfad31b73de19dd1bd34969 | [
"Apache-2.0"
] | null | null | null | model_generation/gpt2.py | sagek21/swift-coreml-transformers | 02228fbd905ffc1cebfad31b73de19dd1bd34969 | [
"Apache-2.0"
] | null | null | null | import coremltools
import coremltools.models.datatypes as datatypes
from coremltools.models import neural_network as neural_network
from coremltools.models.utils import save_spec
import numpy as np
# from test import *
# get weights
from pytorch_transformers import GPT2LMHeadModel
model_name = "gpt2"
lm_head_model = G... | 26.797674 | 111 | 0.73644 | import coremltools
import coremltools.models.datatypes as datatypes
from coremltools.models import neural_network as neural_network
from coremltools.models.utils import save_spec
import numpy as np
from pytorch_transformers import GPT2LMHeadModel
model_name = "gpt2"
lm_head_model = GPT2LMHeadModel.from_pretrained(mode... | true | true |
08fb7a7785862145355d76f0e169c6768ae47322 | 104 | py | Python | compiler/compiler.py | Naretto95/Python.Cpp-VirtualCore | 55b8c27f19169466fba780e4b11c53ba80a5d0e8 | [
"MIT"
] | null | null | null | compiler/compiler.py | Naretto95/Python.Cpp-VirtualCore | 55b8c27f19169466fba780e4b11c53ba80a5d0e8 | [
"MIT"
] | null | null | null | compiler/compiler.py | Naretto95/Python.Cpp-VirtualCore | 55b8c27f19169466fba780e4b11c53ba80a5d0e8 | [
"MIT"
] | null | null | null | import m_parser as ps
import interpreter as inter
import sys
inter.interpreter(ps.parser(sys.argv[1]))
| 17.333333 | 41 | 0.798077 | import m_parser as ps
import interpreter as inter
import sys
inter.interpreter(ps.parser(sys.argv[1]))
| true | true |
08fb7a89daa1464e840ea02c2979223600bb23fc | 5,183 | py | Python | colour/models/rgb/transfer_functions/tests/test_dicom_gsdf.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | 2 | 2020-05-03T20:15:42.000Z | 2021-04-09T18:19:06.000Z | colour/models/rgb/transfer_functions/tests/test_dicom_gsdf.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/transfer_functions/tests/test_dicom_gsdf.py | BPearlstine/colour | 40f0281295496774d2a19eee017d50fd0c265bd8 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.models.rgb.transfer_functions.dicom_gsdf`
module.
"""
from __future__ import division, unicode_literals
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import oetf_DICOMGSDF, eotf_DICOMGSDF
from colour.utilities import domai... | 31.035928 | 79 | 0.648852 |
from __future__ import division, unicode_literals
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import oetf_DICOMGSDF, eotf_DICOMGSDF
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2019 - Colour... | true | true |
08fb7ae7c0f23f949b1e2c010b138cc6bda4b514 | 535 | py | Python | exhibit/contrib/sites/migrations/0002_alter_domain_unique.py | yrhooke/exhibit-proj | 899f340390761423f8d2fe7f1edbad4e9f79435e | [
"MIT"
] | null | null | null | exhibit/contrib/sites/migrations/0002_alter_domain_unique.py | yrhooke/exhibit-proj | 899f340390761423f8d2fe7f1edbad4e9f79435e | [
"MIT"
] | null | null | null | exhibit/contrib/sites/migrations/0002_alter_domain_unique.py | yrhooke/exhibit-proj | 899f340390761423f8d2fe7f1edbad4e9f79435e | [
"MIT"
] | null | null | null | import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sites", "0001_initial")]
operations = [
migrations.AlterField(
model_name="site",
name="domain",
field=models.CharField(
... | 24.318182 | 87 | 0.575701 | import django.contrib.sites.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sites", "0001_initial")]
operations = [
migrations.AlterField(
model_name="site",
name="domain",
field=models.CharField(
... | true | true |
08fb7af6334768d308373d75d445080c9743e163 | 1,121 | py | Python | tests/league_test.py | alexkahan/sports_stats | 6fbc435c8fa0dffb0b7152ce42c055a252858c54 | [
"MIT"
] | null | null | null | tests/league_test.py | alexkahan/sports_stats | 6fbc435c8fa0dffb0b7152ce42c055a252858c54 | [
"MIT"
] | null | null | null | tests/league_test.py | alexkahan/sports_stats | 6fbc435c8fa0dffb0b7152ce42c055a252858c54 | [
"MIT"
] | null | null | null | import pytest
from sportrefpy.nba.league import NBA
from sportrefpy.nhl.league import NHL
from sportrefpy.nfl.league import NFL
from sportrefpy.mlb.league import MLB
from sportrefpy.cbb.cbb import CBB
from sportrefpy.cfb.cfb import CFB
def test_NBA():
nba = NBA()
assert len(nba.teams) == 30
def test_NBA_sta... | 18.683333 | 60 | 0.635147 | import pytest
from sportrefpy.nba.league import NBA
from sportrefpy.nhl.league import NHL
from sportrefpy.nfl.league import NFL
from sportrefpy.mlb.league import MLB
from sportrefpy.cbb.cbb import CBB
from sportrefpy.cfb.cfb import CFB
def test_NBA():
nba = NBA()
assert len(nba.teams) == 30
def test_NBA_sta... | true | true |
08fb7c1581f9bd7aad515fb9f94730fa77183d7a | 872 | py | Python | Solutions/Applications/MPApp.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | null | null | null | Solutions/Applications/MPApp.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | null | null | null | Solutions/Applications/MPApp.py | abefrandsen/numerical_computing | 90559f7c4f387885eb44ea7b1fa19bb602f496cb | [
"CC-BY-3.0"
] | 1 | 2020-10-21T23:06:27.000Z | 2020-10-21T23:06:27.000Z | import scipy as sp
import numpy as np
import scipy.linalg as la
import numpy.linalg as la
import matplotlib.pyplot as plt
'''
A = sp.array([[2,1],[4,2.01]])
la.norm(A)*la.norm(la.pinv(A))
np.linalg.cond(A)
'''
#problem 2
def hilbertCond(n):
'''
I'm just going to construct teh Hilbert Matrx and calculate the
condi... | 30.068966 | 244 | 0.692661 | import scipy as sp
import numpy as np
import scipy.linalg as la
import numpy.linalg as la
import matplotlib.pyplot as plt
def hilbertCond(n):
def hilbert(n):
return sp.array([[1./(x+y-1) for x in range(1,n+1)] for y in range(1,n+1)])
return np.linalg.cond (hilbert(n))
if __name__ == "__main__":
N = sp.arange(1,2... | true | true |
08fb7d037318dafd873d02a3e94ec67bcf983607 | 7,588 | py | Python | test/writing/test_yaml.py | patricksanders/policy_sentry | 3559ce8d3a19728b4f64dfff4cbdf075e7629b39 | [
"MIT"
] | null | null | null | test/writing/test_yaml.py | patricksanders/policy_sentry | 3559ce8d3a19728b4f64dfff4cbdf075e7629b39 | [
"MIT"
] | null | null | null | test/writing/test_yaml.py | patricksanders/policy_sentry | 3559ce8d3a19728b4f64dfff4cbdf075e7629b39 | [
"MIT"
] | null | null | null | import unittest
import json
from policy_sentry.shared.database import connect_db
from policy_sentry.command.write_policy import write_policy_with_template
from policy_sentry.shared.constants import DATABASE_FILE_PATH
db_session = connect_db(DATABASE_FILE_PATH)
valid_cfg_for_crud = {
"mode": "crud",
"name": "... | 38.323232 | 163 | 0.57525 | import unittest
import json
from policy_sentry.shared.database import connect_db
from policy_sentry.command.write_policy import write_policy_with_template
from policy_sentry.shared.constants import DATABASE_FILE_PATH
db_session = connect_db(DATABASE_FILE_PATH)
valid_cfg_for_crud = {
"mode": "crud",
"name": "... | true | true |
08fb7d1a1badf570bbdc6b88b16a046bb317dd6d | 2,156 | py | Python | doc/source/conf.py | tsutterley/pointCollection | 04e4359e463ff8a556e0d078373578bd96390151 | [
"MIT"
] | null | null | null | doc/source/conf.py | tsutterley/pointCollection | 04e4359e463ff8a556e0d078373578bd96390151 | [
"MIT"
] | null | null | null | doc/source/conf.py | tsutterley/pointCollection | 04e4359e463ff8a556e0d078373578bd96390151 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.933333 | 79 | 0.660019 |
project = 'pointCollection'
copyright = '2020, Ben Smith'
author = 'Ben Smith'
release = '1.0.0.0'
extensions = ['recommonmark','sphinx_markdown_tables']
templates_path = ['_templates']
exclude_patterns = ['**.ipynb_checkpoints']
master_doc = 'index'
autosummary_generate = True
html_theme = 'bizstyle'
h... | true | true |
08fb7d34735b2a2e72860edcbdbc55d01853f028 | 115 | py | Python | Mundo01/Python/aula08-016.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula08-016.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula08-016.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | import math
num = float(input('Digite um número: '))
print(f'A parte inteira do número {num} é {math.trunc(num)}')
| 28.75 | 61 | 0.695652 | import math
num = float(input('Digite um número: '))
print(f'A parte inteira do número {num} é {math.trunc(num)}')
| true | true |
08fb7fe89809bbbfa6ee326915274853ed0fd66c | 5,561 | py | Python | lit/helper/toolchain.py | frank-lesser/lldb | f5a215e2b1350fd0fa25780bc585c78b60b365a2 | [
"Apache-2.0"
] | null | null | null | lit/helper/toolchain.py | frank-lesser/lldb | f5a215e2b1350fd0fa25780bc585c78b60b365a2 | [
"Apache-2.0"
] | null | null | null | lit/helper/toolchain.py | frank-lesser/lldb | f5a215e2b1350fd0fa25780bc585c78b60b365a2 | [
"Apache-2.0"
] | null | null | null | import os
import itertools
import platform
import subprocess
import sys
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import FindTool
from lit.llvm.subst import ToolSubst
def use_lldb_substitutions(config):
# Set up substitutions for primary tools. These tools must come from config.lldb_to... | 39.721429 | 95 | 0.600252 | import os
import itertools
import platform
import subprocess
import sys
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import FindTool
from lit.llvm.subst import ToolSubst
def use_lldb_substitutions(config):
dsname = 'debugserver' if platform.system() in ['Darwin'] else 'lldb-se... | true | true |
08fb807ff51037d086cec67fb1ee5ec937360a41 | 3,016 | py | Python | Distance_bw _documents.py | akhilsinghyadav/ALGORITHMS | 26caf5727d9b9dceafee3fce193e1af58dc68bd8 | [
"Apache-2.0"
] | null | null | null | Distance_bw _documents.py | akhilsinghyadav/ALGORITHMS | 26caf5727d9b9dceafee3fce193e1af58dc68bd8 | [
"Apache-2.0"
] | null | null | null | Distance_bw _documents.py | akhilsinghyadav/ALGORITHMS | 26caf5727d9b9dceafee3fce193e1af58dc68bd8 | [
"Apache-2.0"
] | null | null | null | #This algorithm is used to find out variation between 2 documents.(i.e. Somehow like Cheating Catcher)
import math
import sys
def read_file(filename):
try:
f = open(filename, 'r')
return f.readlines()
except IOError:
print("Error opening or reading input file: ", filename)
... | 29.281553 | 113 | 0.612069 |
import math
import sys
def read_file(filename):
try:
f = open(filename, 'r')
return f.readlines()
except IOError:
print("Error opening or reading input file: ", filename)
sys.exit()
def get_words_from_line_list(L):
word_list = []
for line in L:
words_in_li... | true | true |
08fb816f65f8a1118e7a257ad3047ecc8808e2fd | 768 | py | Python | yaff/utils/module_loading.py | fpischedda/yaff | ddf9cb11cdf979cfcdf4072959e4ad7dee984a8d | [
"BSD-3-Clause"
] | 2 | 2015-08-04T09:26:05.000Z | 2015-08-04T20:33:33.000Z | yaff/utils/module_loading.py | fpischedda/yaff | ddf9cb11cdf979cfcdf4072959e4ad7dee984a8d | [
"BSD-3-Clause"
] | 1 | 2015-08-04T10:56:32.000Z | 2015-08-04T11:09:43.000Z | yaff/utils/module_loading.py | fpischedda/yaff | ddf9cb11cdf979cfcdf4072959e4ad7dee984a8d | [
"BSD-3-Clause"
] | 1 | 2015-08-04T10:26:44.000Z | 2015-08-04T10:26:44.000Z | import sys
from importlib import import_module
def import_string(dotted_path):
"""
Import a dotted module path and return the attribute/class designated by
the last name in the path. Raise ImportError if the import failed.
"""
try:
module_path, class_name = dotted_path.rsplit('.', 1)
e... | 32 | 76 | 0.666667 | import sys
from importlib import import_module
def import_string(dotted_path):
try:
module_path, class_name = dotted_path.rsplit('.', 1)
except ValueError:
msg = "%s doesn't look like a module path" % dotted_path
raise(ImportError, ImportError(msg), sys.exc_info()[2])
module = imp... | true | true |
08fb83f37cec297369be63e6609c96f698cf9e35 | 220 | py | Python | doc/print_switch_table.py | smonk/856_b_side | 8c8e49d198d69b005393d3d51f520944dba5cfbb | [
"FSFAP"
] | null | null | null | doc/print_switch_table.py | smonk/856_b_side | 8c8e49d198d69b005393d3d51f520944dba5cfbb | [
"FSFAP"
] | 4 | 2016-03-02T03:14:09.000Z | 2017-03-23T22:58:23.000Z | doc/print_switch_table.py | smonk/856_b_side | 8c8e49d198d69b005393d3d51f520944dba5cfbb | [
"FSFAP"
] | null | null | null | N_MIDI_CHANS=16
for i in xrange(N_MIDI_CHANS):
print "<tr>"
print "<td>{0:d}</td>".format(i+1)
print "{0:04b}".format(i).replace("1","<td>up</td>\n").replace("0","<td>middle/down</td>\n")
print "</tr>"
| 24.444444 | 96 | 0.568182 | N_MIDI_CHANS=16
for i in xrange(N_MIDI_CHANS):
print "<tr>"
print "<td>{0:d}</td>".format(i+1)
print "{0:04b}".format(i).replace("1","<td>up</td>\n").replace("0","<td>middle/down</td>\n")
print "</tr>"
| false | true |
08fb85246b7c4ca81951e621e342a72ddb635cd0 | 8,064 | py | Python | tests/test_integration.py | annawinkler/business-rules | 36e28a2b8e6042f7bde130a59d1e155cf90c383d | [
"MIT"
] | 4 | 2018-03-01T23:32:53.000Z | 2020-06-19T19:06:00.000Z | tests/test_integration.py | maciejpolanczyk/business-rules | 8da88487eee2e96618ab9fab6dc154ee42ee2ba1 | [
"MIT"
] | null | null | null | tests/test_integration.py | maciejpolanczyk/business-rules | 8da88487eee2e96618ab9fab6dc154ee42ee2ba1 | [
"MIT"
] | 2 | 2018-04-13T07:17:39.000Z | 2018-10-02T19:49:52.000Z | from business_rules.engine import check_condition
from business_rules import export_rule_data
from business_rules.actions import rule_action, BaseActions
from business_rules.variables import BaseVariables, string_rule_variable, numeric_rule_variable, boolean_rule_variable
from business_rules.fields import FIELD_TEXT, F... | 45.818182 | 136 | 0.461186 | from business_rules.engine import check_condition
from business_rules import export_rule_data
from business_rules.actions import rule_action, BaseActions
from business_rules.variables import BaseVariables, string_rule_variable, numeric_rule_variable, boolean_rule_variable
from business_rules.fields import FIELD_TEXT, F... | true | true |
08fb85bdca757afcc10a356065829e028740517f | 11,313 | py | Python | models/det/img/faster_rcnn.py | gatarelib/PyTorchCV | 5191d0ddc5c42a4cc8dc5451aa14c263c2f3e77f | [
"Apache-2.0"
] | null | null | null | models/det/img/faster_rcnn.py | gatarelib/PyTorchCV | 5191d0ddc5c42a4cc8dc5451aa14c263c2f3e77f | [
"Apache-2.0"
] | null | null | null | models/det/img/faster_rcnn.py | gatarelib/PyTorchCV | 5191d0ddc5c42a4cc8dc5451aa14c263c2f3e77f | [
"Apache-2.0"
] | 1 | 2019-07-23T02:33:07.000Z | 2019-07-23T02:33:07.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
# The class of DenseASPPDetecNet
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
from torch.nn import functional as F
from torch import nn
from torchvision.... | 45.616935 | 118 | 0.59056 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
from torch.nn import functional as F
from torch import nn
from torchvision.models import vgg16
from utils.layers.det.fr_roi_generator import FRRoiGenerator
from utils.layers.det.rpn_detection_la... | true | true |
08fb860d02891a5bcf98974178d4bd37949be5aa | 17,148 | py | Python | python_modules/dagster/dagster_tests/core_tests/test_composites.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/test_composites.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/test_composites.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from dagster import (
CompositeSolidDefinition,
DagsterInvalidDefinitionError,
DependencyDefinition,
Field,
InputDefinition,
List,
Optional,
Output,
OutputDefinition,
PipelineDefinition,
String,
composite_solid,
execute_pipeline,
execute_s... | 27.837662 | 100 | 0.651446 | import os
import pytest
from dagster import (
CompositeSolidDefinition,
DagsterInvalidDefinitionError,
DependencyDefinition,
Field,
InputDefinition,
List,
Optional,
Output,
OutputDefinition,
PipelineDefinition,
String,
composite_solid,
execute_pipeline,
execute_s... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.