hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7584a7fd7602205edac40036cdc87da3b088b26 | 6,860 | py | Python | tests/test_requests_api.py | Morloth1274/EVE-Online-POCO-manager | f35e6ac49c4451a16011a8c15115c5229b3ce887 | [
"MIT"
] | 1 | 2017-05-06T22:58:13.000Z | 2017-05-06T22:58:13.000Z | tests/test_requests_api.py | Morloth1274/EVE-Online-POCO-manager | f35e6ac49c4451a16011a8c15115c5229b3ce887 | [
"MIT"
] | null | null | null | tests/test_requests_api.py | Morloth1274/EVE-Online-POCO-manager | f35e6ac49c4451a16011a8c15115c5229b3ce887 | [
"MIT"
] | null | null | null | import mock
from xml.etree import ElementTree
from tests.compat import unittest
from evelink.thirdparty.six.moves.urllib.parse import parse_qs
import evelink.api as evelink_api
# Python 2.6's ElementTree raises xml.parsers.expat.ExpatError instead
# of ElementTree.ParseError
_xml_error = getattr(ElementTree, 'ParseE... | 36.88172 | 105 | 0.625802 | import mock
from xml.etree import ElementTree
from tests.compat import unittest
from evelink.thirdparty.six.moves.urllib.parse import parse_qs
import evelink.api as evelink_api
# of ElementTree.ParseError
_xml_error = getattr(ElementTree, 'ParseError', None)
if _xml_error is None:
import xml.parsers.expat
_... | true | true |
f7584b6177457bcab0bb36bcf72d754b6319fecc | 20 | py | Python | simple_playgrounds/playgrounds/collection/rl/__init__.py | Asjidkalam/simple-playgrounds | 72ec42987a33175103191fa9722e0e002f889954 | [
"MIT"
] | 32 | 2015-09-16T08:43:17.000Z | 2021-03-16T13:37:11.000Z | simple_playgrounds/playgrounds/collection/rl/__init__.py | Asjidkalam/simple-playgrounds | 72ec42987a33175103191fa9722e0e002f889954 | [
"MIT"
] | 8 | 2015-08-30T18:34:21.000Z | 2017-12-04T10:06:06.000Z | simple_playgrounds/playgrounds/collection/rl/__init__.py | Asjidkalam/simple-playgrounds | 72ec42987a33175103191fa9722e0e002f889954 | [
"MIT"
] | 21 | 2015-08-27T03:01:50.000Z | 2020-04-13T03:07:22.000Z | from .basic import * | 20 | 20 | 0.75 | from .basic import * | true | true |
f7584bc1f9e815782db85c982d7f553715c306be | 2,482 | py | Python | angel-ps/python/pyangel/find_angel_home.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-11-24T07:40:30.000Z | 2017-11-24T07:40:30.000Z | angel-ps/python/pyangel/find_angel_home.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | angel-ps/python/pyangel/find_angel_home.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-09-28T00:31:04.000Z | 2018-09-28T00:31:04.000Z | #
# Tencent is pleased to support the open source community by making Angel available.
#
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of ... | 36.5 | 102 | 0.654311 |
from __future__ import print_function
import os
import sys
def _find_angel_home():
if "ANGEL_HOME" in os.environ:
return os.environ["ANGEL_HOME"]
def is_angel_home(path):
return (os.path.isfile(os.path.join(path, "bin/angel-submit")) and
(os.path.isdir(os.p... | true | true |
f7584bf8b7690e366cf53d850ec7fca1e154d458 | 5,206 | py | Python | hivemind/compression/quantization.py | artek0chumak/hivemind | 762f116ffcd6c194b888ed64c8a82033cc97dce7 | [
"MIT"
] | 6 | 2020-03-11T17:52:24.000Z | 2020-03-23T07:27:12.000Z | hivemind/compression/quantization.py | artek0chumak/hivemind | 762f116ffcd6c194b888ed64c8a82033cc97dce7 | [
"MIT"
] | 14 | 2020-03-01T21:07:05.000Z | 2020-03-28T17:54:50.000Z | hivemind/compression/quantization.py | learning-at-home/tesseract | c6b2b2d84ccfc890314a2bfece8eef238372d410 | [
"MIT"
] | null | null | null | import math
import os
from abc import ABC, abstractmethod
from concurrent.futures import ThreadPoolExecutor
from typing import Tuple
import numpy as np
import torch
from hivemind.compression.base import CompressionBase, CompressionInfo
from hivemind.proto import runtime_pb2
EXECUTOR = ThreadPoolExecutor(max_workers=... | 45.269565 | 119 | 0.716673 | import math
import os
from abc import ABC, abstractmethod
from concurrent.futures import ThreadPoolExecutor
from typing import Tuple
import numpy as np
import torch
from hivemind.compression.base import CompressionBase, CompressionInfo
from hivemind.proto import runtime_pb2
EXECUTOR = ThreadPoolExecutor(max_workers=... | true | true |
f7584c3a5f1fddb2f0f2a430e5e0087e4d39125e | 4,550 | py | Python | train.py | PangYunsheng8/CGIPool | 2cf22019bad510804021f768c6a0d76bf79b62f6 | [
"MIT"
] | 1 | 2022-01-28T02:57:38.000Z | 2022-01-28T02:57:38.000Z | train.py | LiuChuang0059/CGIPool | 2cf22019bad510804021f768c6a0d76bf79b62f6 | [
"MIT"
] | null | null | null | train.py | LiuChuang0059/CGIPool | 2cf22019bad510804021f768c6a0d76bf79b62f6 | [
"MIT"
] | 5 | 2021-06-14T04:42:39.000Z | 2021-12-21T03:39:19.000Z | import os
import torch
import torch.nn.functional as F
import csv
import glob
import argparse
from datasets.dataloader import build_loader
parser = argparse.ArgumentParser(description="Graph Pooling")
parser.add_argument('--model', type=str, default="SAGNet", help='model name')
parser.add_argument('--see... | 35.546875 | 127 | 0.601538 | import os
import torch
import torch.nn.functional as F
import csv
import glob
import argparse
from datasets.dataloader import build_loader
parser = argparse.ArgumentParser(description="Graph Pooling")
parser.add_argument('--model', type=str, default="SAGNet", help='model name')
parser.add_argument('--see... | true | true |
f7584c69a79ef45a48253f8fffd7a1444d27e499 | 10,703 | py | Python | assembly/sspace.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | 2 | 2019-02-22T12:56:39.000Z | 2020-03-02T03:51:45.000Z | assembly/sspace.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | null | null | null | assembly/sspace.py | wyim-pgl/jcvi | f79ead2fb30a80ead4e3b9602e0bc4a256995864 | [
"BSD-2-Clause"
] | 1 | 2019-09-07T02:57:58.000Z | 2019-09-07T02:57:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
SSPACE scaffolding-related operations.
"""
import os.path as op
import sys
import logging
from copy import deepcopy
from jcvi.formats.fasta import gaps
from jcvi.formats.sizes import Sizes
from jcvi.formats.base import BaseFile, read_block, write_file
from jcvi.form... | 28.69437 | 79 | 0.571989 |
import os.path as op
import sys
import logging
from copy import deepcopy
from jcvi.formats.fasta import gaps
from jcvi.formats.sizes import Sizes
from jcvi.formats.base import BaseFile, read_block, write_file
from jcvi.formats.agp import AGP, AGPLine, reindex, tidy
from jcvi.utils.iter import pairwise
from jcvi.a... | true | true |
f7584c7159a6a97b4bacf6169fa0927792f31e06 | 3,509 | py | Python | python/taichi/examples/simulation/mpm3d.py | rwilliams251/taichi | 442710331be55baf5af17f9667db650c19cbb0b2 | [
"MIT"
] | 1 | 2022-01-04T03:47:15.000Z | 2022-01-04T03:47:15.000Z | python/taichi/examples/simulation/mpm3d.py | rwilliams251/taichi | 442710331be55baf5af17f9667db650c19cbb0b2 | [
"MIT"
] | 1 | 2022-01-27T09:15:00.000Z | 2022-01-27T09:15:00.000Z | python/taichi/examples/simulation/mpm3d.py | rwilliams251/taichi | 442710331be55baf5af17f9667db650c19cbb0b2 | [
"MIT"
] | null | null | null | export_file = '' # use '/tmp/mpm3d.ply' for exporting result to disk
import numpy as np
import taichi as ti
ti.init(arch=ti.gpu)
#dim, n_grid, steps, dt = 2, 128, 20, 2e-4
#dim, n_grid, steps, dt = 2, 256, 32, 1e-4
dim, n_grid, steps, dt = 3, 32, 25, 4e-4
#dim, n_grid, steps, dt = 3, 64, 25, 2e-4
#dim, n_grid, ste... | 29.487395 | 77 | 0.517241 | export_file = ''
import numpy as np
import taichi as ti
ti.init(arch=ti.gpu)
dim, n_grid, steps, dt = 3, 32, 25, 4e-4
n_particles = n_grid**dim // 2**(dim - 1)
dx = 1 / n_grid
p_rho = 1
p_vol = (dx * 0.5)**2
p_mass = p_vol * p_rho
gravity = 9.8
bound = 3
E = 400
x = ti.Vector.field(dim, float, n_particles)... | true | true |
f7584cd887ec0a229f4618ded7a9c9540e4ceb3c | 467 | py | Python | web_server/web_server/tests/test_model_user.py | vidyakanekal/project-vending-machine | 44412fb573963bb595d403489c871d6674e15ea5 | [
"MIT"
] | null | null | null | web_server/web_server/tests/test_model_user.py | vidyakanekal/project-vending-machine | 44412fb573963bb595d403489c871d6674e15ea5 | [
"MIT"
] | 1 | 2019-01-30T00:55:53.000Z | 2019-01-30T01:23:28.000Z | web_server/web_server/tests/test_model_user.py | vidyakanekal/project-vending-machine | 44412fb573963bb595d403489c871d6674e15ea5 | [
"MIT"
] | null | null | null | from django.test import TestCase
from web_server.models import User
class UserTest(TestCase):
def create_user(self, github_username='Al Gore'):
return User.objects.create(github_username=github_username)
def test_user_creation(self):
o1 = self.create_user()
o2 = self.create_user(githu... | 31.133333 | 67 | 0.72591 | from django.test import TestCase
from web_server.models import User
class UserTest(TestCase):
def create_user(self, github_username='Al Gore'):
return User.objects.create(github_username=github_username)
def test_user_creation(self):
o1 = self.create_user()
o2 = self.create_user(githu... | true | true |
f7584d1d7c3f290c18fe05c7e40f93e32022f6bb | 939 | py | Python | checkov/kubernetes/checks/ContainerSecurityContext.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2020-07-26T17:56:20.000Z | 2020-07-26T17:56:20.000Z | checkov/kubernetes/checks/ContainerSecurityContext.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2021-06-02T03:40:50.000Z | 2021-06-02T03:40:50.000Z | checkov/kubernetes/checks/ContainerSecurityContext.py | cclauss/checkov | 60a385fcaff1499cf00c2d0018575fe5ab71f556 | [
"Apache-2.0"
] | 1 | 2021-11-28T09:51:01.000Z | 2021-11-28T09:51:01.000Z |
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ContainerSecurityContext(BaseK8Check):
def __init__(self):
# CIS-1.5 5.7.3
name = "Apply security context to your pods and containers"
# Security context ... | 33.535714 | 100 | 0.689031 |
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.kubernetes.base_spec_check import BaseK8Check
class ContainerSecurityContext(BaseK8Check):
def __init__(self):
name = "Apply security context to your pods and containers"
id = "CKV_K8S_30... | true | true |
f7584d5e770b59d30e4124f7691fae5be6c012ed | 2,436 | py | Python | graphchain/utils.py | gield/graphchain | fd8b02b3fc9b6ac925df3a5ff3e62e8ef40922ea | [
"MIT"
] | 51 | 2018-10-25T08:59:51.000Z | 2022-03-09T05:05:27.000Z | graphchain/utils.py | gield/graphchain | fd8b02b3fc9b6ac925df3a5ff3e62e8ef40922ea | [
"MIT"
] | 22 | 2019-04-29T04:39:35.000Z | 2022-03-28T05:25:59.000Z | graphchain/utils.py | gield/graphchain | fd8b02b3fc9b6ac925df3a5ff3e62e8ef40922ea | [
"MIT"
] | 11 | 2018-10-20T16:07:33.000Z | 2022-01-04T09:37:43.000Z | """Utility functions used by graphchain."""
import string
import sys
from typing import Any, Optional, Set
def _fast_get_size(obj: Any) -> int:
if hasattr(obj, '__len__') and len(obj) <= 0:
return 0
if hasattr(obj, 'sample') and hasattr(obj, 'memory_usage'): # DF, Series.
n = min(len(obj), 10... | 28.658824 | 78 | 0.583333 | import string
import sys
from typing import Any, Optional, Set
def _fast_get_size(obj: Any) -> int:
if hasattr(obj, '__len__') and len(obj) <= 0:
return 0
if hasattr(obj, 'sample') and hasattr(obj, 'memory_usage'):
n = min(len(obj), 1000)
s = obj.sample(n=n).memory_usage(index=True, ... | true | true |
f7584d6ef0d1055fd8b02a3ad3fdd7190572afa4 | 10,580 | py | Python | baconian/core/agent.py | cap-ntu/baconian-project | e84508da60877e387344133a11039edaac35c5bf | [
"MIT"
] | 69 | 2020-01-31T17:44:43.000Z | 2022-03-28T13:09:11.000Z | baconian/core/agent.py | yitongx/baconian-project | e84508da60877e387344133a11039edaac35c5bf | [
"MIT"
] | 5 | 2019-04-28T07:24:26.000Z | 2020-01-29T01:49:51.000Z | baconian/core/agent.py | yitongx/baconian-project | e84508da60877e387344133a11039edaac35c5bf | [
"MIT"
] | 6 | 2019-05-04T02:18:11.000Z | 2019-12-04T22:05:52.000Z | from baconian.core.core import Basic, Env, EnvSpec
from baconian.envs.env_wrapper import Wrapper, ObservationWrapper, StepObservationWrapper
from baconian.common.sampler.sampler import Sampler
from baconian.common.error import *
from baconian.algo.algo import Algo
from typeguard import typechecked
from baconian.algo.mi... | 46 | 119 | 0.622023 | from baconian.core.core import Basic, Env, EnvSpec
from baconian.envs.env_wrapper import Wrapper, ObservationWrapper, StepObservationWrapper
from baconian.common.sampler.sampler import Sampler
from baconian.common.error import *
from baconian.algo.algo import Algo
from typeguard import typechecked
from baconian.algo.mi... | true | true |
f7584e17b5bbc4d25feff69f125fbd44865e8745 | 13,874 | py | Python | Examples/DataManipulation/Python/BuildUGrid.py | Lin1225/vtk_v5.10.0 | b54ac74f4716572862365fbff28cd0ecb8d08c3d | [
"BSD-3-Clause"
] | 83 | 2015-01-05T14:50:50.000Z | 2021-09-17T19:45:26.000Z | Examples/DataManipulation/Python/BuildUGrid.py | Armand0s/homemade_vtk | 6bc7b595a4a7f86e8fa969d067360450fa4e0a6a | [
"BSD-3-Clause"
] | 254 | 2015-01-02T20:39:19.000Z | 2018-11-28T17:16:44.000Z | Examples/DataManipulation/Python/BuildUGrid.py | Armand0s/homemade_vtk | 6bc7b595a4a7f86e8fa969d067360450fa4e0a6a | [
"BSD-3-Clause"
] | 40 | 2015-04-17T16:46:36.000Z | 2021-09-28T22:43:24.000Z | #!/usr/bin/env python
# This example shows how to manually construct unstructured grids
# using Python. Unstructured grids require explicit point and cell
# representations, so every point and cell must be created, and then
# added to the vtkUnstructuredGrid instance.
import vtk
# Create several unstructured grids ... | 35.850129 | 75 | 0.787877 |
import vtk
voxelPoints = vtk.vtkPoints()
voxelPoints.SetNumberOfPoints(8)
voxelPoints.InsertPoint(0, 0, 0, 0)
voxelPoints.InsertPoint(1, 1, 0, 0)
voxelPoints.InsertPoint(2, 0, 1, 0)
voxelPoints.InsertPoint(3, 1, 1, 0)
voxelPoints.InsertPoint(4, 0, 0, 1)
voxelPoints.InsertPoint(5, 1, 0, 1)
voxelPoints.InsertPo... | true | true |
f7584e510705e78ec24105bf7fd393a8584dfc78 | 8,870 | py | Python | ICLR_2022/Flight_delay/PIVEN/PIVEN_flight_delay.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 11 | 2021-11-08T20:38:50.000Z | 2022-01-30T02:46:39.000Z | ICLR_2022/Flight_delay/PIVEN/PIVEN_flight_delay.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2022-01-13T19:46:32.000Z | 2022-02-09T16:23:56.000Z | ICLR_2022/Flight_delay/PIVEN/PIVEN_flight_delay.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2021-12-17T18:38:26.000Z | 2021-12-17T18:38:26.000Z | # -*- coding: utf-8 -*-
"""
Run method, and save results.
Run as:
python main.py --dataset <ds> --method <met>
where dataset name should be in UCI_Datasets folder
and method is piven, qd, deep-ens, mid or only-rmse.
"""
import argparse
import json
import datetime
import tensorflow as tf
# import tensorflow.... | 35.48 | 154 | 0.641375 |
import argparse
import json
import datetime
import tensorflow as tf
import scipy.stats as stats
import itertools
import os
import random
import numpy as np
import data_loader
from DataGen import DataGenerator
from DeepNetPI import TfNetwork
from utils import *
from sklearn.model_selection import train_test_split
... | true | true |
f7584f7dd84e5a7a13ad8bd159aaa286fe0194d4 | 2,291 | py | Python | flexget/ui/plugins/archive/archive.py | tvcsantos/Flexget | e08ce2957dd4f0668911d1e56347369939e4d0a5 | [
"MIT"
] | null | null | null | flexget/ui/plugins/archive/archive.py | tvcsantos/Flexget | e08ce2957dd4f0668911d1e56347369939e4d0a5 | [
"MIT"
] | 1 | 2018-06-09T18:03:35.000Z | 2018-06-09T18:03:35.000Z | flexget/ui/plugins/archive/archive.py | tvcsantos/Flexget | e08ce2957dd4f0668911d1e56347369939e4d0a5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget.ui.webui import db_session, app
from flask import request, render_template, flash, Blueprint
from flexget.plugin import DependencyError
try:
from flexget.plugins.generic.archive import ArchiveEntry, search
except ImportE... | 33.691176 | 106 | 0.665212 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget.ui.webui import db_session, app
from flask import request, render_template, flash, Blueprint
from flexget.plugin import DependencyError
try:
from flexget.plugins.generic.archive import ArchiveEntry, search
except ImportE... | true | true |
f7584f951380967145b47e882cd060d7364b0d87 | 17,666 | py | Python | glacier/concurrent.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | glacier/concurrent.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | glacier/concurrent.py | Rome84/AWS | 32f5b6a83e37e62b0e33658bdab03ea493c905cb | [
"MIT"
] | null | null | null | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the ri... | 41.469484 | 92 | 0.603928 |
import os
import math
import threading
import hashlib
import time
import logging
from boto.compat import Queue
import binascii
from boto.glacier.utils import DEFAULT_PART_SIZE, minimum_part_size, \
chunk_hashes, tree_hash, bytes_to_hex
from boto.glacier.ex... | true | true |
f75850ea5142321fb87bc26eda108faf0e561b35 | 24,929 | py | Python | src/chatbots/util/text_util.py | leolani/cltl-chatbots | 45a2300c87853911b53f19e53ab7c8a4705ba2e6 | [
"Apache-2.0"
] | null | null | null | src/chatbots/util/text_util.py | leolani/cltl-chatbots | 45a2300c87853911b53f19e53ab7c8a4705ba2e6 | [
"Apache-2.0"
] | 14 | 2021-11-02T08:33:53.000Z | 2022-03-30T16:00:01.000Z | src/chatbots/util/text_util.py | leolani/cltl-chatbots | 45a2300c87853911b53f19e53ab7c8a4705ba2e6 | [
"Apache-2.0"
] | 1 | 2021-12-11T11:54:29.000Z | 2021-12-11T11:54:29.000Z | #### Example of an annotation function that adds annotations to a Signal
#### It adds NERC annotations to the TextSignal and returns a list of entities detected
from typing import Text
import requests
import uuid
import jsonpickle
import time
from emissor.representation.annotation import AnnotationType, Token, NER
fro... | 31.595691 | 153 | 0.496249 | ,
):
current_time = int(time.time() * 1e3)
annotations = [
Annotation(annotationType.lower(), token_text, processor_name, current_time)
for token_text in token_text_list
]
signal.mentions.extend(
[
Mention(str(uuid.uuid4()), [segment], [annotation])
fo... | true | true |
f7585161d9aa0514e9efc6cd05e6daecc37d4846 | 1,506 | py | Python | scripts/write_Crosswalk_BLS_QCEW.py | cchiq/flowsa | fc21e8da7c3ba66ca4ae4a0c72f568af7ef5e6c0 | [
"CC0-1.0"
] | null | null | null | scripts/write_Crosswalk_BLS_QCEW.py | cchiq/flowsa | fc21e8da7c3ba66ca4ae4a0c72f568af7ef5e6c0 | [
"CC0-1.0"
] | null | null | null | scripts/write_Crosswalk_BLS_QCEW.py | cchiq/flowsa | fc21e8da7c3ba66ca4ae4a0c72f568af7ef5e6c0 | [
"CC0-1.0"
] | null | null | null | # write_Crosswalk_BLS_QCEW.py (scripts)
# !/usr/bin/env python3
# coding=utf-8
# ingwersen.wesley@epa.gov
"""
Create a crosswalk for BLS QCEW to NAICS 2012. Downloaded data is already provided in NAICS
"""
import pandas as pd
from flowsa.common import datapath, fbaoutputpath
def unique_activity_names(datasource, year... | 34.227273 | 102 | 0.665339 |
import pandas as pd
from flowsa.common import datapath, fbaoutputpath
def unique_activity_names(datasource, years):
df = []
for y in years:
df = pd.read_parquet(fbaoutputpath + datasource + "_" + str(y) + ".parquet", engine="pyarrow")
df.append(df)
df = df[['SourceName', 'ActivityProdu... | true | true |
f75851ecb573e8b0a6d39f6419b6d9de524d03ba | 10,432 | py | Python | src/adb_long_duration_recorder_old.py | louiscklaw/adb_long_duration_recorder | 9bb43833de9255e6e3e5dd7302d2184b0c05897a | [
"MIT"
] | null | null | null | src/adb_long_duration_recorder_old.py | louiscklaw/adb_long_duration_recorder | 9bb43833de9255e6e3e5dd7302d2184b0c05897a | [
"MIT"
] | null | null | null | src/adb_long_duration_recorder_old.py | louiscklaw/adb_long_duration_recorder | 9bb43833de9255e6e3e5dd7302d2184b0c05897a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
#! /usr/env python3
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a... | 30.592375 | 169 | 0.664206 |
import os
import sys
import logging
import traceback
import subprocess
import shlex
import math
import logging
import time
from pprint import pprint
import os.path as op
from adb import adb_commands
from adb import sign_m2crypto
def get_host_command_output(command):
result = subprocess.check_output(shle... | true | true |
f758520505eac1e5a43b7818a1de184e682857df | 32,553 | py | Python | sklearn/impute/_base.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 2 | 2021-08-24T21:08:38.000Z | 2021-09-11T02:27:04.000Z | sklearn/impute/_base.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 26 | 2019-11-11T18:17:02.000Z | 2020-05-14T02:57:37.000Z | sklearn/impute/_base.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 9 | 2019-11-22T17:07:16.000Z | 2020-03-30T06:11:33.000Z | # Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com>
# Sergey Feldman <sergeyfeldman@gmail.com>
# License: BSD 3 clause
import numbers
import warnings
from collections import Counter
import numpy as np
import numpy.ma as ma
from scipy import sparse as sp
from scipy import stats
from ..base import Base... | 35.772527 | 88 | 0.58179 |
import numbers
import warnings
from collections import Counter
import numpy as np
import numpy.ma as ma
from scipy import sparse as sp
from scipy import stats
from ..base import BaseEstimator, TransformerMixin
from ..utils.sparsefuncs import _get_median
from ..utils.validation import check_is_fitted
from ..utils.... | true | true |
f75853102a76118bd47a798f7b0e0ec15ac0c439 | 11,856 | py | Python | applications/pytorch/miniDALL-E/train.py | payoto/graphcore_examples | 46d2b7687b829778369fc6328170a7b14761e5c6 | [
"MIT"
] | 260 | 2019-11-18T01:50:00.000Z | 2022-03-28T23:08:53.000Z | applications/pytorch/miniDALL-E/train.py | payoto/graphcore_examples | 46d2b7687b829778369fc6328170a7b14761e5c6 | [
"MIT"
] | 27 | 2020-01-28T23:07:50.000Z | 2022-02-14T15:37:06.000Z | applications/pytorch/miniDALL-E/train.py | payoto/graphcore_examples | 46d2b7687b829778369fc6328170a7b14761e5c6 | [
"MIT"
] | 56 | 2019-11-18T02:13:12.000Z | 2022-02-28T14:36:09.000Z | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
# Copyright (c) 2021 lucidrains
# This file has been modified by Graphcore
import argparse
from pathlib import Path
import datetime
import time
from glob import glob
import os
import shutil
from log import Logger
import torch
import poptorch
import popart
impo... | 34.768328 | 144 | 0.641363 |
import argparse
from pathlib import Path
import datetime
import time
from glob import glob
import os
import shutil
from log import Logger
import torch
import poptorch
import popart
import wandb
from poptorch.optim import Adam, AdamW
from torch.optim.lr_scheduler import ReduceLROnPlateau
from models.dalle impor... | true | true |
f758534c7768e14f87e2c79bd6c56cff40958c2e | 1,726 | py | Python | setup.py | ben-hudson/tsplib95 | c9edc6bf905ff33e38c0f475e855b3d866d72dcd | [
"Apache-2.0"
] | 45 | 2018-10-06T18:45:11.000Z | 2022-03-24T08:42:45.000Z | setup.py | ben-hudson/tsplib95 | c9edc6bf905ff33e38c0f475e855b3d866d72dcd | [
"Apache-2.0"
] | 17 | 2018-10-02T05:37:55.000Z | 2021-11-15T17:47:41.000Z | setup.py | ben-hudson/tsplib95 | c9edc6bf905ff33e38c0f475e855b3d866d72dcd | [
"Apache-2.0"
] | 11 | 2018-10-01T11:51:46.000Z | 2021-07-28T06:36:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
'Deprecated~=1... | 27.83871 | 61 | 0.632097 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'Click>=6.0',
'Deprecated~=1.2.9',
'networkx~=2.1',
'tabulate~=0.8.7',
]
setup_requirem... | true | true |
f758534ead4a148a333ca4102bec7180fee8258d | 1,347 | py | Python | tf_throttle/build/catkin_generated/generate_cached_setup.py | xplorer-robot/xplorer | 51e43613017455331864a166b1bb830819e823a0 | [
"MIT"
] | null | null | null | tf_throttle/build/catkin_generated/generate_cached_setup.py | xplorer-robot/xplorer | 51e43613017455331864a166b1bb830819e823a0 | [
"MIT"
] | null | null | null | tf_throttle/build/catkin_generated/generate_cached_setup.py | xplorer-robot/xplorer | 51e43613017455331864a166b1bb830819e823a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.... | 43.451613 | 102 | 0.740906 |
from __future__ import print_function
import argparse
import os
import stat
import sys
if os.path.exists(os.path.join('/opt/ros/kinetic/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.join('/opt/ros/kinetic/share/catkin/cmake', '..', 'python'))
try:
from catkin.environment_cache im... | true | true |
f7585366496998ea108d1e61c84fc39874cdaf25 | 211 | py | Python | kobra_kombat_game/kobra_game/snack.py | Codigos-de-Guerra/KobraKombat | 01178bbb91002793972fce35ecbfdf4906a83038 | [
"MIT"
] | null | null | null | kobra_kombat_game/kobra_game/snack.py | Codigos-de-Guerra/KobraKombat | 01178bbb91002793972fce35ecbfdf4906a83038 | [
"MIT"
] | 1 | 2019-11-27T15:24:16.000Z | 2019-12-06T04:39:26.000Z | kobra_kombat_game/kobra_game/snack.py | Codigos-de-Guerra/KobraKombat | 01178bbb91002793972fce35ecbfdf4906a83038 | [
"MIT"
] | null | null | null | import pygame
from .cube import Cube
# hehe to usando herença
class Snack(Cube):# {{{
def __init__(self, pos):# {{{
self.pos = pos
Cube.__init__(self,self.pos,(0,255,0), (0, 0))# }}}
# }}}
| 19.181818 | 59 | 0.57346 | import pygame
from .cube import Cube
class Snack(Cube):
def __init__(self, pos):
self.pos = pos
Cube.__init__(self,self.pos,(0,255,0), (0, 0))
| true | true |
f75854839b5773e9e3c664fa15e5fd71bcce1f8e | 3,862 | py | Python | other_codes/perfProf.py | deno750/VRP_Optimization | 653c950b59acb3a1cd96d1e96bb334c90655eaa2 | [
"MIT"
] | 2 | 2021-03-06T13:33:46.000Z | 2021-09-25T00:15:49.000Z | other_codes/perfProf.py | deno750/VRP_Optimization | 653c950b59acb3a1cd96d1e96bb334c90655eaa2 | [
"MIT"
] | null | null | null | other_codes/perfProf.py | deno750/VRP_Optimization | 653c950b59acb3a1cd96d1e96bb334c90655eaa2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from __future__ import print_function
import numpy as np
import matplotlib
#matplotlib.use('PDF')
import matplotlib.pyplot as plt
import sys
from optparse import OptionParser
# parameters
defLW = 1.2 # default line width
defMS = 7 # default marker size
dashes = ['-', # solid line
'--', # ... | 31.145161 | 119 | 0.666235 |
from __future__ import print_function
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import sys
from optparse import OptionParser
defLW = 1.2
defMS = 7
dashes = ['-',
'--',
'-.',
':',
'-',
'--']
markers = ['+', 'x', 's', '^', 'o', 'd']
colors = ['r', 'b', 'y', 'g', 'm', 'c'... | true | true |
f7585620c0df3e32c3cef8a51fdd7422e37ec2c9 | 4,007 | py | Python | doc/source/conf.py | pyansys/dev-guide | c7b68ab0346215f0677baa9946cfaabf49526230 | [
"MIT"
] | 14 | 2021-10-20T13:09:14.000Z | 2022-02-28T10:07:32.000Z | doc/source/conf.py | pyansys/dev-guide | c7b68ab0346215f0677baa9946cfaabf49526230 | [
"MIT"
] | 36 | 2021-10-19T06:08:04.000Z | 2022-03-31T13:32:50.000Z | doc/source/conf.py | pyansys/dev-guide | c7b68ab0346215f0677baa9946cfaabf49526230 | [
"MIT"
] | 2 | 2021-11-11T18:43:22.000Z | 2022-03-16T18:29:31.000Z | """Sphinx documentation configuration file for the pyansys developer's guide."""
from datetime import datetime
from ansys_sphinx_theme import (
__version__,
ansys_logo_white,
ansys_logo_white_cropped,
pyansys_logo_black,
watermark,
)
from ansys_sphinx_theme.latex import generate_preamble
# Project... | 30.823077 | 92 | 0.687547 | from datetime import datetime
from ansys_sphinx_theme import (
__version__,
ansys_logo_white,
ansys_logo_white_cropped,
pyansys_logo_black,
watermark,
)
from ansys_sphinx_theme.latex import generate_preamble
project = "PyAnsys Developer's Guide"
copyright = f"(c) {datetime.now().year} ANSYS, Inc.... | true | true |
f758564d8084b220aa31d3a65fc2bb951eb6a90c | 3,637 | py | Python | tests/functional/models/test_slate_model.py | Pocket/recommendation-api | f13fc101054b102b0467b3c0ff31f3e091b2818f | [
"Apache-2.0"
] | 14 | 2021-03-03T15:43:39.000Z | 2022-03-27T02:45:50.000Z | tests/functional/models/test_slate_model.py | Pocket/recommendation-api | f13fc101054b102b0467b3c0ff31f3e091b2818f | [
"Apache-2.0"
] | 325 | 2021-03-03T22:07:45.000Z | 2022-03-31T16:07:35.000Z | tests/functional/models/test_slate_model.py | Pocket/recommendation-api | f13fc101054b102b0467b3c0ff31f3e091b2818f | [
"Apache-2.0"
] | 2 | 2021-07-25T16:41:32.000Z | 2021-08-06T13:15:28.000Z | from unittest.mock import patch
from tests.functional.test_dynamodb_base import TestDynamoDBBase
from app.models.slate_config import SlateConfigModel
from app.models.slate_experiment import SlateExperimentModel
from app.models.slate import SlateModel
slate_config_id = 'test-slate_lineup-config-id'
slate_experiment =... | 37.885417 | 118 | 0.59857 | from unittest.mock import patch
from tests.functional.test_dynamodb_base import TestDynamoDBBase
from app.models.slate_config import SlateConfigModel
from app.models.slate_experiment import SlateExperimentModel
from app.models.slate import SlateModel
slate_config_id = 'test-slate_lineup-config-id'
slate_experiment =... | true | true |
f7585830afdbad55248cb31272466579e42ffc24 | 13,400 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/network_groupnet_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/network_groupnet_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/network_groupnet_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.networ... | 34.358974 | 227 | 0.626418 |
import pprint
import re
import six
from isi_sdk_9_0_0.models.network_groupnet import NetworkGroupnet
class NetworkGroupnetExtended(object):
swagger_types = {
'allow_wildcard_subdomains': 'bool',
'description': 'str',
'dns_cache_enabled': 'bool',
'dns_options': 'list[str]... | true | true |
f7585970b2213a2785366acbce6a1d8633865539 | 284 | py | Python | Tuplas, Listas, Dicio/ex77.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | 1 | 2021-10-17T13:00:19.000Z | 2021-10-17T13:00:19.000Z | Tuplas, Listas, Dicio/ex77.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | null | null | null | Tuplas, Listas, Dicio/ex77.py | viniTWL/Python-Projects | 1c4d2417efd896623263287b1d2391f7c551674c | [
"MIT"
] | null | null | null | print('=== IDENTIFICANDO VOGAIS =====')
words = ('Computador', 'Programaçao', 'Cadeira', 'Mousepad', 'Fone')
vogais = ('a', 'e', 'i', 'o', 'u')
for c in words:
print(f'\nNa palavra {c} temos', end=' ')
for v in c:
if v.lower() in 'aeiou':
print(v, end='')
| 31.555556 | 68 | 0.517606 | print('=== IDENTIFICANDO VOGAIS =====')
words = ('Computador', 'Programaçao', 'Cadeira', 'Mousepad', 'Fone')
vogais = ('a', 'e', 'i', 'o', 'u')
for c in words:
print(f'\nNa palavra {c} temos', end=' ')
for v in c:
if v.lower() in 'aeiou':
print(v, end='')
| true | true |
f7585982c307e0e4e4385d5612d1ae2e428469c9 | 294 | py | Python | corporatebonds/pipelines.py | casbeebc/corporate-bonds | 27e4a2806f0889c35e2b5587528e9a676d26144a | [
"MIT"
] | 1 | 2022-02-03T06:07:24.000Z | 2022-02-03T06:07:24.000Z | corporatebonds/pipelines.py | casbeebc/corporate-bonds | 27e4a2806f0889c35e2b5587528e9a676d26144a | [
"MIT"
] | null | null | null | corporatebonds/pipelines.py | casbeebc/corporate-bonds | 27e4a2806f0889c35e2b5587528e9a676d26144a | [
"MIT"
] | 2 | 2019-05-28T19:11:38.000Z | 2020-03-24T03:36:04.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class CorporateBondsPipeline(object):
def process_item(self, item, spider):
return item
| 24.5 | 65 | 0.717687 |
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class CorporateBondsPipeline(object):
def process_item(self, item, spider):
return item
| true | true |
f7585a342aec8d60c4407c089d6b180f0d85f4f6 | 21 | py | Python | src/python/config.py | DannaShirley/aws-eventbridge-oauth-client-delete-blueprint | e85a0e5966beac1ac292a6f52299ebb1879cc98c | [
"MIT"
] | null | null | null | src/python/config.py | DannaShirley/aws-eventbridge-oauth-client-delete-blueprint | e85a0e5966beac1ac292a6f52299ebb1879cc98c | [
"MIT"
] | 1 | 2022-02-17T19:05:52.000Z | 2022-02-17T19:05:52.000Z | src/python/config.py | DannaShirley/aws-eventbridge-oauth-client-delete-blueprint | e85a0e5966beac1ac292a6f52299ebb1879cc98c | [
"MIT"
] | 1 | 2022-02-17T19:05:39.000Z | 2022-02-17T19:05:39.000Z | pager_duty_token = '' | 21 | 21 | 0.761905 | pager_duty_token = '' | true | true |
f7585c1b9e4fe3421c038f696894a0ca0f0c4d35 | 1,955 | py | Python | docs/source/conf.py | yds05238/interview-prep | 5f4b0e6603bbe27e318f5c162f5ab9585ddd4cf1 | [
"MIT"
] | null | null | null | docs/source/conf.py | yds05238/interview-prep | 5f4b0e6603bbe27e318f5c162f5ab9585ddd4cf1 | [
"MIT"
] | null | null | null | docs/source/conf.py | yds05238/interview-prep | 5f4b0e6603bbe27e318f5c162f5ab9585ddd4cf1 | [
"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... | 33.706897 | 79 | 0.663939 |
project = 'Coding Interview Prep'
copyright = '2021, Jaemok Yoon'
author = 'Jaemok Yoon'
release = '0.1'
extensions = [
'sphinx.ext.duration',
'myst_parser',
]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'sphinx_book_theme'
html_static_path = [... | true | true |
f7585f0fa4de05484ab23180aa19789eb7c21413 | 3,275 | py | Python | deepchem/feat/base_classes.py | martonlanga/deepchem | af2db874484603ade489fa513eac193b38ce6d56 | [
"MIT"
] | 3 | 2022-02-06T09:13:51.000Z | 2022-02-19T15:03:35.000Z | deepchem/feat/base_classes.py | martonlanga/deepchem | af2db874484603ade489fa513eac193b38ce6d56 | [
"MIT"
] | 1 | 2020-07-13T18:59:49.000Z | 2020-07-13T18:59:49.000Z | deepchem/feat/base_classes.py | fenomeinc/deepchem | 1c007fbae899a49fe3c40f41e7273ed21867fef9 | [
"MIT"
] | 1 | 2021-04-06T20:32:02.000Z | 2021-04-06T20:32:02.000Z | """
Feature calculations.
"""
import logging
import types
import numpy as np
import multiprocessing
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
def _featurize_complex(featurizer, mol_pdb_file, protein_pdb_file, log_message):
logging.info(log_mess... | 24.62406 | 80 | 0.659237 | import logging
import types
import numpy as np
import multiprocessing
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "BSD 3-clause"
def _featurize_complex(featurizer, mol_pdb_file, protein_pdb_file, log_message):
logging.info(log_message)
return featurizer._feat... | true | true |
f758608a88ac8c9dd2010d2bf00577529442ed58 | 61,669 | py | Python | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py | deryrahman/google-cloud-python | b55058c4b2328fde32f29bfd8ea04708fcc578e0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 45.145681 | 172 | 0.592486 |
import functools
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.gapic_v1.routing_header
import google.api_core.grpc_helpers
im... | true | true |
f75860daca32753d06169bc262f13e1370200c9a | 1,650 | py | Python | tfx/benchmarks/tft_benchmark_chicago_taxi.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1,813 | 2019-02-04T17:17:30.000Z | 2022-03-29T13:39:30.000Z | tfx/benchmarks/tft_benchmark_chicago_taxi.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 2,710 | 2019-02-14T00:41:00.000Z | 2022-03-31T07:23:00.000Z | tfx/benchmarks/tft_benchmark_chicago_taxi.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 731 | 2019-02-04T17:59:18.000Z | 2022-03-31T06:45:51.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.375 | 89 | 0.744848 |
from absl import flags
from tfx.benchmarks import tft_benchmark_base
from tfx.benchmarks.datasets.chicago_taxi import dataset
from tensorflow.python.platform import test
FLAGS = flags.FLAGS
flags.DEFINE_integer("num_analyzers_wide", 10,
"Number of analyzers in the TFT preprocessin... | true | true |
f75861427e5b15eeabfa148fa1de5edd3d43917b | 3,339 | py | Python | dataloaders/wrapper.py | parvex/residual-continual-learning-benchmark | 8eeb2e57ecf0711e075eb02e8ed06fc8e7b9f20d | [
"MIT"
] | null | null | null | dataloaders/wrapper.py | parvex/residual-continual-learning-benchmark | 8eeb2e57ecf0711e075eb02e8ed06fc8e7b9f20d | [
"MIT"
] | null | null | null | dataloaders/wrapper.py | parvex/residual-continual-learning-benchmark | 8eeb2e57ecf0711e075eb02e8ed06fc8e7b9f20d | [
"MIT"
] | null | null | null | from os import path
import torch
import torch.utils.data as data
class CacheClassLabel(data.Dataset):
"""
A dataset wrapper that has a quick access to all labels of data.
"""
def __init__(self, dataset):
super(CacheClassLabel, self).__init__()
self.dataset = dataset
self.labels... | 31.8 | 109 | 0.632225 | from os import path
import torch
import torch.utils.data as data
class CacheClassLabel(data.Dataset):
def __init__(self, dataset):
super(CacheClassLabel, self).__init__()
self.dataset = dataset
self.labels = torch.LongTensor(len(dataset)).fill_(-1)
label_cache_filename = path.join(... | true | true |
f75861bfe73550bc8171c261af5d02cf30101bbc | 503 | py | Python | deal/_cli/_common.py | life4/deal | 65e3191198dbc0573e88ff2cfd5d9cd3b5f0907e | [
"MIT"
] | 311 | 2019-10-04T04:27:42.000Z | 2022-03-30T23:38:30.000Z | deal/_cli/_common.py | life4/deal | 65e3191198dbc0573e88ff2cfd5d9cd3b5f0907e | [
"MIT"
] | 42 | 2019-09-29T17:05:05.000Z | 2022-03-18T08:10:00.000Z | deal/_cli/_common.py | life4/deal | 65e3191198dbc0573e88ff2cfd5d9cd3b5f0907e | [
"MIT"
] | 17 | 2019-09-29T20:08:39.000Z | 2022-03-04T08:22:13.000Z | from pathlib import Path
from typing import Iterator
def get_paths(path: Path) -> Iterator[Path]:
"""Recursively yields python files.
"""
if not path.exists():
raise FileNotFoundError(str(path))
if path.is_file():
if path.suffix == '.py':
yield path
return
for s... | 25.15 | 44 | 0.582505 | from pathlib import Path
from typing import Iterator
def get_paths(path: Path) -> Iterator[Path]:
if not path.exists():
raise FileNotFoundError(str(path))
if path.is_file():
if path.suffix == '.py':
yield path
return
for subpath in path.iterdir():
if subpath.nam... | true | true |
f75862260854dc163119d547a30c4fb0201e8cf3 | 7,018 | py | Python | hs_logisticregression.py | Davjes15/ardas_platform | d962e7280ac4477fc3ee71280e90aeab58f74bd6 | [
"MIT"
] | 1 | 2022-01-08T18:35:51.000Z | 2022-01-08T18:35:51.000Z | hs_logisticregression.py | Davjes15/ardas_platform | d962e7280ac4477fc3ee71280e90aeab58f74bd6 | [
"MIT"
] | null | null | null | hs_logisticregression.py | Davjes15/ardas_platform | d962e7280ac4477fc3ee71280e90aeab58f74bd6 | [
"MIT"
] | null | null | null | # Implementation of Random Forest model to classify failures in a hydraulic process
# Hydraulic system can be found : https://archive.ics.uci.edu/ml/datasets/Condition+monitoring+of+hydraulic+systems
# The data set contains raw process sensor data (i.e. without feature extraction) which are structured as matrices (tab-... | 37.329787 | 134 | 0.65674 |
import pandas as pd
import numpy as np
import os, sys
import pickle
import sklearn as sk
from pathlib import Path
from sklearn import preprocessing
from sklearn.metrics import confusion_matrix, recall_score, precision_score, accuracy_score
from sklear... | true | true |
f7586258a5997bfa6c8bb15913277eb714fe87ac | 88 | py | Python | config/development.py | librazh/financial-analysis | f252f5248e2b9b062945b5c9930577f9656a7ebc | [
"Apache-2.0"
] | null | null | null | config/development.py | librazh/financial-analysis | f252f5248e2b9b062945b5c9930577f9656a7ebc | [
"Apache-2.0"
] | null | null | null | config/development.py | librazh/financial-analysis | f252f5248e2b9b062945b5c9930577f9656a7ebc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Created on 2018-09-16
@author: Basel
'''
DEBUG = True | 12.571429 | 24 | 0.534091 |
DEBUG = True | true | true |
f75863a91ae8648f388fd4dd5010b38274efa7fc | 1,017 | py | Python | flask/api/models/user.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | 1 | 2019-10-18T00:49:27.000Z | 2019-10-18T00:49:27.000Z | flask/api/models/user.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | null | null | null | flask/api/models/user.py | mktung/tvgs-crm | be992a19b46f7d7eeaf90c9c9105a3630ff20292 | [
"MIT"
] | null | null | null | from uuid import uuid4
from api.core import Mixin
from .base import db as DB
class User(Mixin, DB.Model):
"""User model."""
__tablename__ = "users"
id = DB.Column(
DB.Integer,
nullable=False,
primary_key=True
)
uuid = DB.Column(
DB.String(32),
unique=True... | 21.638298 | 64 | 0.618486 | from uuid import uuid4
from api.core import Mixin
from .base import db as DB
class User(Mixin, DB.Model):
__tablename__ = "users"
id = DB.Column(
DB.Integer,
nullable=False,
primary_key=True
)
uuid = DB.Column(
DB.String(32),
unique=True,
nullable=Fal... | true | true |
f75863db66151b6a76c2896cade3d83f738f4814 | 193 | py | Python | bangumi/spiders/bangumi_anime_list_spider.py | project-nichijou/nichijou.server.spider.bangumi | e84b13b0e8624a34185ced052ad0f4d41bf5bead | [
"MIT"
] | 3 | 2021-06-24T14:39:43.000Z | 2021-07-30T06:25:01.000Z | bangumi/spiders/bangumi_anime_list_spider.py | project-nichijou/bangumi-spider | e84b13b0e8624a34185ced052ad0f4d41bf5bead | [
"MIT"
] | 12 | 2021-06-20T16:08:20.000Z | 2021-06-29T02:43:54.000Z | bangumi/spiders/bangumi_anime_list_spider.py | project-nichijou/nichijou.server.spider.bangumi | e84b13b0e8624a34185ced052ad0f4d41bf5bead | [
"MIT"
] | 1 | 2021-06-25T14:28:54.000Z | 2021-06-25T14:28:54.000Z | import scrapy
from bangumi.spiders.bangumi_list_spider import BangumiListSpider
class BangumiAnimeListSpider(BangumiListSpider):
name = 'bangumi_anime_list'
type = 'anime'
start_page = 1
| 19.3 | 65 | 0.818653 | import scrapy
from bangumi.spiders.bangumi_list_spider import BangumiListSpider
class BangumiAnimeListSpider(BangumiListSpider):
name = 'bangumi_anime_list'
type = 'anime'
start_page = 1
| true | true |
f75863e7fe4871742672f4aa4de9e6a42addb1ce | 520 | py | Python | examples/progress.py | takelushi/combu | a0df46301ef9432de825719ccca2a29a66fe49f7 | [
"MIT"
] | 1 | 2020-12-16T03:58:10.000Z | 2020-12-16T03:58:10.000Z | examples/progress.py | takelushi/combu | a0df46301ef9432de825719ccca2a29a66fe49f7 | [
"MIT"
] | 9 | 2020-12-15T21:47:46.000Z | 2021-01-27T13:49:59.000Z | examples/progress.py | takelushi/combu | a0df46301ef9432de825719ccca2a29a66fe49f7 | [
"MIT"
] | null | null | null | """Progress."""
import time
import combu
def _f(v1, v2):
time.sleep(0.1)
return v1 * v2
params_a = {'v1': range(1, 3), 'v2': range(1, 3)}
for _, _ in combu.execute(_f, params_a, progress=True):
pass
comb = combu.Combu(_f, progress=True)
params_b = {'v1': [1, 10, 100], 'v2': range(1, 11)}
for _, _ in... | 18.571429 | 73 | 0.5 |
import time
import combu
def _f(v1, v2):
time.sleep(0.1)
return v1 * v2
params_a = {'v1': range(1, 3), 'v2': range(1, 3)}
for _, _ in combu.execute(_f, params_a, progress=True):
pass
comb = combu.Combu(_f, progress=True)
params_b = {'v1': [1, 10, 100], 'v2': range(1, 11)}
for _, _ in comb.execute(pa... | true | true |
f758646802809f7bccea0e6ebcc14cbf7e999532 | 414 | py | Python | python/tests/test_knapsack_branching.py | vincenzopalazzo/benchmarks | 3187a57d86bc3ac41cd98e4f08e6e809f3ef3a71 | [
"BSD-3-Clause"
] | null | null | null | python/tests/test_knapsack_branching.py | vincenzopalazzo/benchmarks | 3187a57d86bc3ac41cd98e4f08e6e809f3ef3a71 | [
"BSD-3-Clause"
] | null | null | null | python/tests/test_knapsack_branching.py | vincenzopalazzo/benchmarks | 3187a57d86bc3ac41cd98e4f08e6e809f3ef3a71 | [
"BSD-3-Clause"
] | null | null | null | """Testing the implementation with some small input"""
from benchamarks.bm.knapsack_branching import knapsack_branching
from benchamarks.bm.knapsack_comm import Entry
def test_knapsack_branching_one() -> None:
inputs = [
Entry(40, 2),
Entry(50, 3.14),
Entry(100, 1.98),
Entry(95, 5... | 24.352941 | 64 | 0.647343 |
from benchamarks.bm.knapsack_branching import knapsack_branching
from benchamarks.bm.knapsack_comm import Entry
def test_knapsack_branching_one() -> None:
inputs = [
Entry(40, 2),
Entry(50, 3.14),
Entry(100, 1.98),
Entry(95, 5),
Entry(30, 3),
]
res = knapsack_branc... | true | true |
f75864e6c78e386ea8721e6aeacb596a65629ad8 | 3,051 | py | Python | byceps/blueprints/admin/authentication/login/views.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/blueprints/admin/authentication/login/views.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/blueprints/admin/authentication/login/views.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.blueprints.admin.authentication.login.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask import abort, g, redirect, request
from flask_babel import gettext
from .....services.authenticati... | 27.736364 | 75 | 0.686988 |
from flask import abort, g, redirect, request
from flask_babel import gettext
from .....services.authentication.exceptions import AuthenticationFailed
from .....services.authentication import service as authentication_service
from .....services.authentication.session import service as session_service
from .....signal... | true | true |
f75867bec64d5afe1c82e1432ae20c2f59366240 | 3,270 | py | Python | airflow/upgrade/rules/import_changes.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/upgrade/rules/import_changes.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 26 | 2019-08-05T13:44:11.000Z | 2022-03-30T10:06:18.000Z | airflow/upgrade/rules/import_changes.py | shrutimantri/airflow | 61eaaacd20ab0f743786df895cf8f232b3b2a48c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 8 | 2019-08-26T07:47:05.000Z | 2021-11-23T19:55:18.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.333333 | 107 | 0.679511 |
from typing import NamedTuple, Optional, List
from cached_property import cached_property
from airflow import conf
from airflow.upgrade.rules.base_rule import BaseRule
from airflow.upgrade.rules.renamed_classes import ALL
from airflow.utils.dag_processing import list_py_file_paths
class ImportChang... | true | true |
f75867c6ad71fe59c16a1b18a544ef53289c324c | 1,048 | py | Python | setup.py | Anton-4/flowpipe | ce63a14424a1d0b08ed50a65fb29821904a3fcbc | [
"MIT"
] | null | null | null | setup.py | Anton-4/flowpipe | ce63a14424a1d0b08ed50a65fb29821904a3fcbc | [
"MIT"
] | null | null | null | setup.py | Anton-4/flowpipe | ce63a14424a1d0b08ed50a65fb29821904a3fcbc | [
"MIT"
] | 1 | 2020-07-29T15:24:19.000Z | 2020-07-29T15:24:19.000Z | from setuptools import setup
from setuptools import find_packages
with open('README.md') as stream:
long_description = stream.read()
REQUIREMENTS = [
'ascii-canvas>=1.2.2',
'ordereddict>=1.1',
'strip-hints>=0.1.7'
]
setup(name='flowpipe',
version='0.6.0',
author='Paul Schweizer',
a... | 31.757576 | 66 | 0.616412 | from setuptools import setup
from setuptools import find_packages
with open('README.md') as stream:
long_description = stream.read()
REQUIREMENTS = [
'ascii-canvas>=1.2.2',
'ordereddict>=1.1',
'strip-hints>=0.1.7'
]
setup(name='flowpipe',
version='0.6.0',
author='Paul Schweizer',
a... | true | true |
f75867eb387f54905f50e3898a0c076e96b8b2ce | 7,709 | py | Python | run_lib.py | NCIA-Diffusion/ScoreSDE | b5a562908daf66e6dcf0b791beb83f1fcb61174b | [
"MIT"
] | 2 | 2022-03-02T06:54:28.000Z | 2022-03-02T06:56:45.000Z | run_lib.py | NCIA-Diffusion/ScoreSDE | b5a562908daf66e6dcf0b791beb83f1fcb61174b | [
"MIT"
] | null | null | null | run_lib.py | NCIA-Diffusion/ScoreSDE | b5a562908daf66e6dcf0b791beb83f1fcb61174b | [
"MIT"
] | 2 | 2022-02-23T11:49:15.000Z | 2022-03-02T06:56:46.000Z | import os
import logging
import copy
from tqdm import trange
from datetime import datetime
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from torchvision.utils import save_image
from utils import ema
from lib.dataset import DataLooper
from lib.sde import VPSDE
from lib.model.ddpm i... | 30.113281 | 87 | 0.550396 | import os
import logging
import copy
from tqdm import trange
from datetime import datetime
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from torchvision.utils import save_image
from utils import ema
from lib.dataset import DataLooper
from lib.sde import VPSDE
from lib.model.ddpm i... | true | true |
f75869e2132bb7e4e1e57bc54c7bf500bf0d35a2 | 11,371 | py | Python | miyu_bot/commands/master_filter/event_filter.py | qwewqa/miyu-bot | dddd533d803a056651b8233b632a86b86e35a388 | [
"MIT"
] | 11 | 2021-01-29T07:16:11.000Z | 2022-02-25T01:40:22.000Z | miyu_bot/commands/master_filter/event_filter.py | qwewqa/miyu-bot | dddd533d803a056651b8233b632a86b86e35a388 | [
"MIT"
] | null | null | null | miyu_bot/commands/master_filter/event_filter.py | qwewqa/miyu-bot | dddd533d803a056651b8233b632a86b86e35a388 | [
"MIT"
] | 3 | 2021-02-13T02:06:39.000Z | 2021-05-08T18:43:12.000Z | import datetime as dt
import re
from typing import Optional, Union
import discord
from d4dj_utils.master.common_enums import EventType
from d4dj_utils.master.event_master import EventMaster, EventState
from miyu_bot.bot.bot import PrefContext
from miyu_bot.bot.servers import Server
from miyu_bot.commands.common.asset... | 51.220721 | 257 | 0.594583 | import datetime as dt
import re
from typing import Optional, Union
import discord
from d4dj_utils.master.common_enums import EventType
from d4dj_utils.master.event_master import EventMaster, EventState
from miyu_bot.bot.bot import PrefContext
from miyu_bot.bot.servers import Server
from miyu_bot.commands.common.asset... | true | true |
f7586a6f10340e7608d72e2e86670bd8967e483f | 22,114 | py | Python | tests/test_do_spaces.py | mcueto/django-storages | 3908c94b928cc5c97a443d51e473656813776fd7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_do_spaces.py | mcueto/django-storages | 3908c94b928cc5c97a443d51e473656813776fd7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_do_spaces.py | mcueto/django-storages | 3908c94b928cc5c97a443d51e473656813776fd7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import pickle
import threading
import warnings
from datetime import datetime
from unittest import skipIf
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from... | 36.552066 | 111 | 0.608619 |
from __future__ import unicode_literals
import gzip
import pickle
import threading
import warnings
from datetime import datetime
from unittest import skipIf
from botocore.exceptions import ClientError
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.base... | true | true |
f7586b000eecdff1b43a09575d4a94ba7e456fa0 | 6,061 | py | Python | tests/test_core.py | joshfp/fastai | eb455070adaea072b4771e340d48a371c6c0c4e2 | [
"Apache-2.0"
] | 1 | 2019-01-29T22:13:29.000Z | 2019-01-29T22:13:29.000Z | tests/test_core.py | jamesrequa/fastai | 794365cd7f734b5e1027d7e19c99e648fbb9a12b | [
"Apache-2.0"
] | null | null | null | tests/test_core.py | jamesrequa/fastai | 794365cd7f734b5e1027d7e19c99e648fbb9a12b | [
"Apache-2.0"
] | null | null | null | import pytest, torch
import numpy as np
from fastai import *
from tempfile import TemporaryDirectory
def test_cpus(): assert num_cpus() >= 1
@pytest.mark.parametrize("p, q, expected", [
(5 , 1 , [5]),
(5 , [1,1], [5, 5]),
([5], 1 , [5]),
([5], [1,1], [5, 5]),
("ab" , "cd" , ["a", "... | 31.9 | 159 | 0.538855 | import pytest, torch
import numpy as np
from fastai import *
from tempfile import TemporaryDirectory
def test_cpus(): assert num_cpus() >= 1
@pytest.mark.parametrize("p, q, expected", [
(5 , 1 , [5]),
(5 , [1,1], [5, 5]),
([5], 1 , [5]),
([5], [1,1], [5, 5]),
("ab" , "cd" , ["a", "... | true | true |
f7586bb0cf519b2b9edb83099c9177de960aa7af | 1,085 | py | Python | networkit/viztasks.py | maxvogel/NetworKit-mirror2 | 02a1805a4eda56fbdd647852afcfac26bcb77099 | [
"MIT"
] | null | null | null | networkit/viztasks.py | maxvogel/NetworKit-mirror2 | 02a1805a4eda56fbdd647852afcfac26bcb77099 | [
"MIT"
] | null | null | null | networkit/viztasks.py | maxvogel/NetworKit-mirror2 | 02a1805a4eda56fbdd647852afcfac26bcb77099 | [
"MIT"
] | null | null | null | # local imports
from . import nxadapter
from . import community
from _NetworKit import ParallelPartitionCoarsening
# external imports
import networkx
def save(name, dir="."):
""" Save a figure """
savefig(os.path.join(dir, "{0}.pdf".format(name)), bbox_inches="tight", transparent=True)
def coloringToColorList(G, ... | 30.138889 | 140 | 0.723502 |
from . import nxadapter
from . import community
from _NetworKit import ParallelPartitionCoarsening
import networkx
def save(name, dir="."):
savefig(os.path.join(dir, "{0}.pdf".format(name)), bbox_inches="tight", transparent=True)
def coloringToColorList(G, coloring):
clist = []
nColors = len(coloring.keys())
... | true | true |
f7586c8c660677be36c10f179505e6fcf6e3a3ee | 1,783 | py | Python | PyBank/main.py | EstherBaili/python-Challenge | 3f36338f93c3b1222614697231cad8c630391e75 | [
"ADSL"
] | null | null | null | PyBank/main.py | EstherBaili/python-Challenge | 3f36338f93c3b1222614697231cad8c630391e75 | [
"ADSL"
] | null | null | null | PyBank/main.py | EstherBaili/python-Challenge | 3f36338f93c3b1222614697231cad8c630391e75 | [
"ADSL"
] | null | null | null | import csv
import os
csvPath = os.path.abspath("C:/Users/li116/OneDrive/Desktop/python-Challenge/PyBank/resource/budget_data.csv")
with open(csvPath,"r") as input_csv_file:
csvreader = csv.reader(input_csv_file, delimiter=",")
#exclude header
next(csvreader)
#get months list
months = [ ]
amounts... | 28.758065 | 109 | 0.652271 | import csv
import os
csvPath = os.path.abspath("C:/Users/li116/OneDrive/Desktop/python-Challenge/PyBank/resource/budget_data.csv")
with open(csvPath,"r") as input_csv_file:
csvreader = csv.reader(input_csv_file, delimiter=",")
next(csvreader)
months = [ ]
amounts = [ ]
dates = [ ]
for ... | true | true |
f7586cb4312ee529245633e03cb80fa101f0a741 | 36,828 | py | Python | google/cloud/dialogflowcx_v3/services/experiments/async_client.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflowcx_v3/services/experiments/async_client.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflowcx_v3/services/experiments/async_client.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 40.47033 | 142 | 0.627322 |
from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from... | true | true |
f7586cbe1d57981fcaf7088f8fcea34816737841 | 4,076 | py | Python | varsom_landslide_client/models/alert_info_area_geocode.py | NVE/python-varsom-landslide-client | 553f562d463e67545daa9fc9bfdd554f3c5d471c | [
"MIT"
] | null | null | null | varsom_landslide_client/models/alert_info_area_geocode.py | NVE/python-varsom-landslide-client | 553f562d463e67545daa9fc9bfdd554f3c5d471c | [
"MIT"
] | null | null | null | varsom_landslide_client/models/alert_info_area_geocode.py | NVE/python-varsom-landslide-client | 553f562d463e67545daa9fc9bfdd554f3c5d471c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Jordskredvarsel API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
im... | 29.536232 | 119 | 0.594946 |
import pprint
import re
import six
class AlertInfoAreaGeocode(object):
swagger_types = {
'value_name_field': 'str',
'value_field': 'str'
}
attribute_map = {
'value_name_field': 'valueNameField',
'value_field': 'valueField'
}
def __init__(self, value_name_fie... | true | true |
f7586dab25cea2ae0ce86336c1686bdffbf0abd3 | 155 | py | Python | tests/test_mdio.py | Samtec-ASH/pyrpio | b087be9c935367ab4d2424371b2b3fffe5375138 | [
"MIT"
] | 5 | 2020-02-27T19:49:48.000Z | 2022-03-11T02:49:49.000Z | tests/test_mdio.py | Samtec-ASH/pyrpio | b087be9c935367ab4d2424371b2b3fffe5375138 | [
"MIT"
] | 1 | 2021-02-19T10:08:50.000Z | 2021-02-19T22:42:23.000Z | tests/test_mdio.py | Samtec-ASH/pyrpio | b087be9c935367ab4d2424371b2b3fffe5375138 | [
"MIT"
] | 2 | 2021-06-07T14:13:52.000Z | 2021-10-17T11:59:36.000Z | import pytest
from pyrpio.mdio import MDIO
class TestMDIO:
def test_open(self):
assert True
def test_transfer(self):
assert True
| 15.5 | 28 | 0.677419 | import pytest
from pyrpio.mdio import MDIO
class TestMDIO:
def test_open(self):
assert True
def test_transfer(self):
assert True
| true | true |
f7586e47a874b10e20826983ab6c81b9596a93f7 | 59,284 | py | Python | pyseqlab/utilities.py | bratao/-PySeqLab | fea1c4bd4d43565b1bb20a789d78946e1022d0ff | [
"MIT"
] | 6 | 2019-05-03T22:14:11.000Z | 2022-03-04T10:36:31.000Z | pyseqlab/utilities.py | bratao/-PySeqLab | fea1c4bd4d43565b1bb20a789d78946e1022d0ff | [
"MIT"
] | 1 | 2020-11-12T02:46:15.000Z | 2020-11-12T03:12:45.000Z | pyseqlab/utilities.py | bratao/-PySeqLab | fea1c4bd4d43565b1bb20a789d78946e1022d0ff | [
"MIT"
] | 3 | 2019-05-04T03:50:49.000Z | 2020-06-27T00:43:29.000Z | """
@author: ahmed allam <ahmed.allam@yale.edu>
"""
import os
import pickle
import shutil
from datetime import datetime
from copy import deepcopy
from itertools import combinations
import heapq
import numpy
class SequenceStruct(object):
r"""class for representing each sequence/segment
Args:
... | 37.592898 | 145 | 0.547635 | import os
import pickle
import shutil
from datetime import datetime
from copy import deepcopy
from itertools import combinations
import heapq
import numpy
class SequenceStruct(object):
def __init__(self, X, Y, seg_other_symbol=None):
self.seg_attr = {}
self.X = X
self.Y = (Y, seg_other_sy... | true | true |
f7586e7709f11aebeac250ea9ba6948ee1e85f87 | 418 | py | Python | src/wechaty_puppet_mock/__init__.py | wechaty/python-wechaty-puppet-mock | ffad481545b93d328f346b42bd7e9565f5dda88a | [
"Apache-2.0"
] | null | null | null | src/wechaty_puppet_mock/__init__.py | wechaty/python-wechaty-puppet-mock | ffad481545b93d328f346b42bd7e9565f5dda88a | [
"Apache-2.0"
] | null | null | null | src/wechaty_puppet_mock/__init__.py | wechaty/python-wechaty-puppet-mock | ffad481545b93d328f346b42bd7e9565f5dda88a | [
"Apache-2.0"
] | null | null | null | """import all external package"""
from wechaty_puppet_mock.puppet_mock import PuppetMock, PuppetMockOptions
from wechaty_puppet_mock.exceptions import (
MockEnvironmentError
)
from wechaty_puppet_mock.mock.environment import EnvironmentMock
from wechaty_puppet_mock.mock.mocker import Mocker
__all__ = [
'Puppet... | 26.125 | 73 | 0.787081 | from wechaty_puppet_mock.puppet_mock import PuppetMock, PuppetMockOptions
from wechaty_puppet_mock.exceptions import (
MockEnvironmentError
)
from wechaty_puppet_mock.mock.environment import EnvironmentMock
from wechaty_puppet_mock.mock.mocker import Mocker
__all__ = [
'PuppetMock',
'PuppetMockOptions',
... | true | true |
f7586f0277dcd698c785c3103266a974f355858e | 5,067 | py | Python | src/CodeExecResource.py | narhen/code-exec-as-a-service | 8cf4edd2bb6381cfd73f4610f8706af7ce8bae02 | [
"MIT"
] | 2 | 2021-01-02T16:22:38.000Z | 2021-07-11T09:50:53.000Z | src/CodeExecResource.py | narhen/code-exec-as-a-service | 8cf4edd2bb6381cfd73f4610f8706af7ce8bae02 | [
"MIT"
] | null | null | null | src/CodeExecResource.py | narhen/code-exec-as-a-service | 8cf4edd2bb6381cfd73f4610f8706af7ce8bae02 | [
"MIT"
] | null | null | null | import falcon
import tempfile
import base64
import traceback
import string
from json import loads
from os import path, unlink
from shutil import rmtree
from settings import application as app_settings
from Exceptions import ValidationException
class Languages:
def __init__(self, docker_client):
self.docker... | 39.27907 | 110 | 0.650286 | import falcon
import tempfile
import base64
import traceback
import string
from json import loads
from os import path, unlink
from shutil import rmtree
from settings import application as app_settings
from Exceptions import ValidationException
class Languages:
def __init__(self, docker_client):
self.docker... | true | true |
f7586fa6c35becb418cac21949112a443d64e24e | 1,766 | py | Python | pymortafix/utils.py | Mortafix/PyMortafix | e82afa6be50942116ad93e51e85ae4fa596aad46 | [
"MIT"
] | null | null | null | pymortafix/utils.py | Mortafix/PyMortafix | e82afa6be50942116ad93e51e85ae4fa596aad46 | [
"MIT"
] | null | null | null | pymortafix/utils.py | Mortafix/PyMortafix | e82afa6be50942116ad93e51e85ae4fa596aad46 | [
"MIT"
] | null | null | null | from re import findall, match, sub
from colorifix.colorifix import erase
from pymortafix._getchar import _Getch
def get_sub_from_matching(dictionary, matching):
index = [i for i, group in enumerate(matching.groups()) if group]
matched = list(dictionary)[index[0]] if index else None
return dictionary.get(... | 31.535714 | 83 | 0.634202 | from re import findall, match, sub
from colorifix.colorifix import erase
from pymortafix._getchar import _Getch
def get_sub_from_matching(dictionary, matching):
index = [i for i, group in enumerate(matching.groups()) if group]
matched = list(dictionary)[index[0]] if index else None
return dictionary.get(... | true | true |
f758704e27977923040ff6d2e7dc3c43acb05f4c | 46,638 | py | Python | Tests/Marketplace/upload_packs.py | freimer/content | ade5d3ea39a7c06330d01493af4babdbb991524f | [
"MIT"
] | null | null | null | Tests/Marketplace/upload_packs.py | freimer/content | ade5d3ea39a7c06330d01493af4babdbb991524f | [
"MIT"
] | null | null | null | Tests/Marketplace/upload_packs.py | freimer/content | ade5d3ea39a7c06330d01493af4babdbb991524f | [
"MIT"
] | null | null | null | import json
import os
import sys
import argparse
import shutil
import uuid
import prettytable
import glob
import requests
import logging
from datetime import datetime
from zipfile import ZipFile
from typing import Any, Tuple, Union
from Tests.Marketplace.marketplace_services import init_storage_client, init_bigquery_cl... | 45.903543 | 120 | 0.673635 | import json
import os
import sys
import argparse
import shutil
import uuid
import prettytable
import glob
import requests
import logging
from datetime import datetime
from zipfile import ZipFile
from typing import Any, Tuple, Union
from Tests.Marketplace.marketplace_services import init_storage_client, init_bigquery_cl... | true | true |
f75871cf3a74b52389953763ee36ef8bb46ecafa | 1,235 | py | Python | data/p4VQE/R4/benchmark/startPyquil685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=15
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... | 23.301887 | 64 | 0.60081 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(0)
prog += CNOT(3,0)
prog += CNOT(3,0)
prog += Z(3)
... | true | true |
f7587217613ce503a5570f1db03474046498432a | 481 | py | Python | senstech/config/desktop.py | martinzoller/senstech | 25b5a1eaa6aa6d33a0db8449d8e73d77caa3e6b7 | [
"MIT"
] | null | null | null | senstech/config/desktop.py | martinzoller/senstech | 25b5a1eaa6aa6d33a0db8449d8e73d77caa3e6b7 | [
"MIT"
] | null | null | null | senstech/config/desktop.py | martinzoller/senstech | 25b5a1eaa6aa6d33a0db8449d8e73d77caa3e6b7 | [
"MIT"
] | 2 | 2021-02-01T15:17:50.000Z | 2021-08-14T22:26:58.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Senstech",
"category": "Modules",
"label": _("Senstech"),
"color": "grey",
"icon": "icon cube-blue",
"type": "module"
},
{
"module_name": "Senstech Settin... | 20.041667 | 49 | 0.56341 |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Senstech",
"category": "Modules",
"label": _("Senstech"),
"color": "grey",
"icon": "icon cube-blue",
"type": "module"
},
{
"module_name": "Senstech Settings",
"category": "Mo... | true | true |
f758727ae9d6ec9ca45110f0b05b2dbea1a60127 | 2,018 | py | Python | setup.py | antgonza/qp-qiime2 | 73133537b8af17e614bc0630657b29a86266d0b7 | [
"BSD-3-Clause"
] | 4 | 2016-05-06T18:31:23.000Z | 2019-05-10T16:40:32.000Z | setup.py | antgonza/qp-qiime2 | 73133537b8af17e614bc0630657b29a86266d0b7 | [
"BSD-3-Clause"
] | 59 | 2016-06-30T22:34:20.000Z | 2021-11-18T16:39:04.000Z | setup.py | antgonza/qp-qiime2 | 73133537b8af17e614bc0630657b29a86266d0b7 | [
"BSD-3-Clause"
] | 3 | 2016-04-13T20:54:38.000Z | 2017-04-29T16:42:02.000Z | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# Copyright (c) 2013, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------------... | 35.403509 | 79 | 0.600595 |
from setuptools import setup
from qiime2 import __version__ as qiime2_version
__version__ = qiime2_version
classes = """
Development Status :: 5 - Production/Stable
License :: OSI Approved :: BSD License
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Software Development :: Li... | true | true |
f758734595709d92a85aa436a4091fd534884147 | 2,125 | py | Python | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/support/encoded_file.py | Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/support/encoded_file.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 25 | 2018-07-23T08:34:15.000Z | 2021-11-05T07:13:36.000Z | SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/support/encoded_file.py | PolideaPlayground/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | """
The LLVM Compiler Infrastructure
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
Prepares language bindings for LLDB build process. Run with --help
to see a description of the supported command line arguments.
"""
# Python modules:... | 29.109589 | 96 | 0.631529 |
import io
import sys
import six
def _encoded_read(old_read, encoding):
def impl(size):
result = old_read(size)
if six.PY2:
result = result.encode(encoding)
return result
return impl
def _encoded_write(old_write, encoding):
def impl(s):
... | true | true |
f75874eb9254c69a49fe536ca7564fa9bac4671f | 1,399 | py | Python | src/covid_model_seiir_pipeline/pipeline/parameter_fit/workflow.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 23 | 2020-05-25T00:20:32.000Z | 2022-01-18T10:32:09.000Z | src/covid_model_seiir_pipeline/pipeline/parameter_fit/workflow.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 15 | 2020-06-15T16:34:22.000Z | 2021-08-15T22:11:37.000Z | src/covid_model_seiir_pipeline/pipeline/parameter_fit/workflow.py | yukgu/covid-model-seiir-pipeline | 3433034d3f089938e7993b6321d570365bdf62db | [
"BSD-3-Clause"
] | 11 | 2020-05-24T21:57:29.000Z | 2021-09-07T18:21:15.000Z | import shutil
from typing import Dict
from covid_shared import workflow
import covid_model_seiir_pipeline
from covid_model_seiir_pipeline.pipeline.parameter_fit.specification import FIT_JOBS, FitScenario
class BetaFitTaskTemplate(workflow.TaskTemplate):
tool = workflow.get_jobmon_tool(covid_model_seiir_pipeline... | 32.534884 | 97 | 0.661187 | import shutil
from typing import Dict
from covid_shared import workflow
import covid_model_seiir_pipeline
from covid_model_seiir_pipeline.pipeline.parameter_fit.specification import FIT_JOBS, FitScenario
class BetaFitTaskTemplate(workflow.TaskTemplate):
tool = workflow.get_jobmon_tool(covid_model_seiir_pipeline... | true | true |
f758751cc2c46581edf419efe1b032d99771f9a9 | 599 | py | Python | refs/utils.py | muhfahmir/Discord-Bot-GUI | df078ec9c9f2aa253dca4cc212f9787cb9a64eb7 | [
"MIT"
] | null | null | null | refs/utils.py | muhfahmir/Discord-Bot-GUI | df078ec9c9f2aa253dca4cc212f9787cb9a64eb7 | [
"MIT"
] | null | null | null | refs/utils.py | muhfahmir/Discord-Bot-GUI | df078ec9c9f2aa253dca4cc212f9787cb9a64eb7 | [
"MIT"
] | 5 | 2021-10-01T04:20:50.000Z | 2021-10-30T07:11:00.000Z | import discord
from dataclasses import dataclass
@dataclass
class FakeAvatar:
url: str
class FakeUser(discord.Object):
@property
def avatar(self):
return FakeAvatar("https://cdn.discordapp.com/embed/avatars/0.png")
@property
def mention(self):
return f"<@{self.id}>"
@prope... | 17.114286 | 75 | 0.611018 | import discord
from dataclasses import dataclass
@dataclass
class FakeAvatar:
url: str
class FakeUser(discord.Object):
@property
def avatar(self):
return FakeAvatar("https://cdn.discordapp.com/embed/avatars/0.png")
@property
def mention(self):
return f"<@{self.id}>"
@prope... | true | true |
f75875deb478d59645b574519de38c0ac0d5aa26 | 6,313 | py | Python | pyscf/cc/__init__.py | r-peng/pyscf | 9a14f9bcc63bc75f5939cb4d00eb47861d8d8989 | [
"Apache-2.0"
] | 2 | 2021-06-30T22:33:35.000Z | 2021-11-22T18:02:36.000Z | pyscf/cc/__init__.py | r-peng/pyscf | 9a14f9bcc63bc75f5939cb4d00eb47861d8d8989 | [
"Apache-2.0"
] | null | null | null | pyscf/cc/__init__.py | r-peng/pyscf | 9a14f9bcc63bc75f5939cb4d00eb47861d8d8989 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 35.466292 | 101 | 0.665769 |
from pyscf.cc import ccsd
from pyscf.cc import ccsd_lambda
from pyscf.cc import ccsd_rdm
from pyscf.cc import addons
from pyscf.cc import rccsd
from pyscf.cc import uccsd
from pyscf.cc import gccsd
from pyscf.cc import eom_rccsd
from pyscf.cc import eom_uccsd
from pyscf.cc import eom_gccsd
from pyscf imp... | true | true |
f75877f256341e5bddecf60c43152f92383e0179 | 15,107 | py | Python | test/functional/wallet_listtransactions.py | apokalyzr/bitcoin | 5b4b8f76f3ae11064d4aa3ac157558e364751fd2 | [
"MIT"
] | 65,371 | 2015-01-01T06:52:02.000Z | 2022-03-31T23:29:23.000Z | test/functional/wallet_listtransactions.py | apokalyzr/bitcoin | 5b4b8f76f3ae11064d4aa3ac157558e364751fd2 | [
"MIT"
] | 18,259 | 2015-01-01T03:22:57.000Z | 2022-03-31T23:18:25.000Z | test/functional/wallet_listtransactions.py | apokalyzr/bitcoin | 5b4b8f76f3ae11064d4aa3ac157558e364751fd2 | [
"MIT"
] | 28,827 | 2015-01-01T00:25:45.000Z | 2022-03-31T23:48:15.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listtransactions API."""
from decimal import Decimal
import os
import shutil
from test_frame... | 52.093103 | 150 | 0.616933 |
from decimal import Decimal
import os
import shutil
from test_framework.messages import (
COIN,
tx_from_hex,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_array_result,
assert_equal,
assert_raises_rpc_error,
)
class ListTransactions... | true | true |
f75878a71688b613b37bad25492bb5aa13c1bae2 | 708 | py | Python | app/models/games.py | chrislaskey/kingdom | be82551824adadfc0c70e08b188eb45adae974c1 | [
"MIT"
] | 6 | 2015-02-17T23:40:42.000Z | 2021-11-04T17:22:57.000Z | app/models/games.py | chrislaskey/kingdom | be82551824adadfc0c70e08b188eb45adae974c1 | [
"MIT"
] | null | null | null | app/models/games.py | chrislaskey/kingdom | be82551824adadfc0c70e08b188eb45adae974c1 | [
"MIT"
] | 1 | 2020-12-15T16:01:57.000Z | 2020-12-15T16:01:57.000Z | from . import db
games_users = db.Table(
'games_users',
db.Column('game_id', db.Integer(), db.ForeignKey('game.id')),
db.Column('user_id', db.Integer(), db.ForeignKey('user.id'))
)
class Game(db.Model):
'''
status - text field
game status, values created|declined|started|withdrew|ended
... | 26.222222 | 67 | 0.618644 | from . import db
games_users = db.Table(
'games_users',
db.Column('game_id', db.Integer(), db.ForeignKey('game.id')),
db.Column('user_id', db.Integer(), db.ForeignKey('user.id'))
)
class Game(db.Model):
id = db.Column(db.Integer, primary_key=True)
status = db.Column(db.String(255))
name = db... | true | true |
f758790d250b3d764d0093aae0ddbceb9cdbdba3 | 7,852 | py | Python | src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | 1 | 2019-03-30T20:49:32.000Z | 2019-03-30T20:49:32.000Z | src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | 4 | 2018-08-08T20:01:17.000Z | 2018-09-17T15:20:06.000Z | src/command_modules/azure-cli-profile/azure/cli/command_modules/profile/custom.py | srinathnarayanan/azure-cli | b98bddc8dd18e6cb15fc44a6dc160b02a0bd255a | [
"MIT"
] | 1 | 2018-04-14T01:46:00.000Z | 2018-04-14T01:46:00.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 40.061224 | 118 | 0.678171 |
from __future__ import print_function
from knack.log import get_logger
from knack.prompting import prompt_pass, NoTTYException
from knack.util import CLIError
from azure.cli.core._profile import Profile
from azure.cli.core.util import in_cloud_console
logger = get_logger(__name__)
_CLOUD_CONSOLE_LOGOUT_WARNIN... | true | true |
f7587bd238a3f29f3aed5cdf9ee8568fa318382b | 157 | py | Python | liyi_cute/processor/tokenizers/__init__.py | daiyizheng/liyi-cute | 2881a5e74a483a5e7a9fa1d9f16444f442735661 | [
"Apache-2.0"
] | null | null | null | liyi_cute/processor/tokenizers/__init__.py | daiyizheng/liyi-cute | 2881a5e74a483a5e7a9fa1d9f16444f442735661 | [
"Apache-2.0"
] | null | null | null | liyi_cute/processor/tokenizers/__init__.py | daiyizheng/liyi-cute | 2881a5e74a483a5e7a9fa1d9f16444f442735661 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/5/15 16:01
# @Author : Yizheng Dai
# @Email : 387942239@qq.com
# @File : __init__.py.py | 26.166667 | 29 | 0.579618 | true | true | |
f7587db5ecd4251ae6c89b5cb1fc0d82165654b9 | 9,814 | py | Python | test/functional/p2p_blockfilters.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/functional/p2p_blockfilters.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | test/functional/p2p_blockfilters.py | VaderCoinProject/vadercoin | b513c794b014d40e5aad281dd1f54845c46d216c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Vadercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_COMPACT_FILTERS (BIP 157/158).
Tests that a node configured with -blockfilterindex and -p... | 37.891892 | 99 | 0.642653 |
from test_framework.messages import (
FILTER_TYPE_BASIC,
NODE_COMPACT_FILTERS,
hash256,
msg_getcfcheckpt,
msg_getcfheaders,
msg_getcfilters,
ser_uint256,
uint256_from_str,
)
from test_framework.p2p import P2PInterface
from test_framework.test_framework import VadercoinTestFramework
... | true | true |
f7587df850f1398706b06810556071a03d64723d | 18,366 | py | Python | conda/models/prefix_graph.py | forrestwaters/conda | 0614e8108bf2ac392dcff2143d9b2e028a8623e9 | [
"BSD-3-Clause"
] | 1 | 2019-07-03T05:39:44.000Z | 2019-07-03T05:39:44.000Z | conda/models/prefix_graph.py | al-yakubovich/conda | fa4c53f14216a8e94bbb04784195beef9545c8bc | [
"BSD-3-Clause"
] | null | null | null | conda/models/prefix_graph.py | al-yakubovich/conda | fa4c53f14216a8e94bbb04784195beef9545c8bc | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict, OrderedDict
from logging import getLogger
from .enums import NoarchType
from .match_spec import Mat... | 39.076596 | 99 | 0.576881 |
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict, OrderedDict
from logging import getLogger
from .enums import NoarchType
from .match_spec import MatchSpec
from .._vendor.boltons.setutils import IndexedSet
from ..base.context import context
from... | true | true |
f7587e8cd69fb9cb8fb04e790b3f09b5570a5e83 | 31 | py | Python | pytemple/version.py | malczuuu/pytemple | 66731e5fc55a64566f74904e0dab5cae17dd9af0 | [
"MIT"
] | null | null | null | pytemple/version.py | malczuuu/pytemple | 66731e5fc55a64566f74904e0dab5cae17dd9af0 | [
"MIT"
] | null | null | null | pytemple/version.py | malczuuu/pytemple | 66731e5fc55a64566f74904e0dab5cae17dd9af0 | [
"MIT"
] | null | null | null | __version__ = "1.1.0-SNAPSHOT"
| 15.5 | 30 | 0.709677 | __version__ = "1.1.0-SNAPSHOT"
| true | true |
f7587e8f3b87565e487482a59981cef07a5f45c6 | 324 | py | Python | iCount/externals/__init__.py | genialis/iCount | 80dba0f7292a364c62843d71e76c1b22e6268e14 | [
"MIT"
] | null | null | null | iCount/externals/__init__.py | genialis/iCount | 80dba0f7292a364c62843d71e76c1b22e6268e14 | [
"MIT"
] | 1 | 2021-09-30T12:55:37.000Z | 2021-09-30T12:55:37.000Z | iCount/externals/__init__.py | ulelab/iCount | b9dc1b21b80e4dae77b3ac33734514091fbe3151 | [
"MIT"
] | 4 | 2021-03-23T12:38:55.000Z | 2021-05-14T10:10:00.000Z | """.. Line to protect from pydocstyle D205, D400.
Externals
=========
A number of external software is needed for iCount to work.
.. automodule:: iCount.externals.cutadapt
:members:
.. automodule:: iCount.externals.star
:members:
"""
from . import cutadapt
from . import star
EXPECTED_CUTADAPT_VERSION = '1.... | 16.2 | 59 | 0.703704 |
from . import cutadapt
from . import star
EXPECTED_CUTADAPT_VERSION = '1.14'
| true | true |
f7587e985dae807443f615bbb8a004fd82e19d7e | 1,376 | py | Python | analysis_pb2_grpc.py | charliezon/stock_success | 5deb7891122378dc9598da59a4142642c788d082 | [
"Apache-2.0"
] | null | null | null | analysis_pb2_grpc.py | charliezon/stock_success | 5deb7891122378dc9598da59a4142642c788d082 | [
"Apache-2.0"
] | null | null | null | analysis_pb2_grpc.py | charliezon/stock_success | 5deb7891122378dc9598da59a4142642c788d082 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import analysis_pb2 as analysis__pb2
class AnalysisStub(object):
"""The analysis service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.RequireAnalysis... | 29.276596 | 76 | 0.739826 |
import grpc
import analysis_pb2 as analysis__pb2
class AnalysisStub(object):
def __init__(self, channel):
self.RequireAnalysis = channel.unary_unary(
'/analysis.Analysis/RequireAnalysis',
request_serializer=analysis__pb2.AnalysisRequest.SerializeToString,
response_deserializer=analysi... | true | true |
f7587f0db0b02be3fd2cb24364727cbbf361b25e | 3,333 | py | Python | okonf/facts/apt.py | hoh/Okonf | 26b3629b20504bc1c4ee51f054df6a59e54427ae | [
"Apache-2.0"
] | 1 | 2018-03-20T14:55:41.000Z | 2018-03-20T14:55:41.000Z | okonf/facts/apt.py | hoh/Okonf | 26b3629b20504bc1c4ee51f054df6a59e54427ae | [
"Apache-2.0"
] | null | null | null | okonf/facts/apt.py | hoh/Okonf | 26b3629b20504bc1c4ee51f054df6a59e54427ae | [
"Apache-2.0"
] | null | null | null | import re
from typing import Iterable, Dict, Tuple, Union, Optional
from .abstract import Fact
from ..connectors.abstract import Executor
RE_UPGRADEABLE = r'([^\/]+)\/([^\s]+)\s+([^\s]+)\s+(\w+)\s+' \
r'\[upgradable from:\s+([^\s]+)\]$'
def parse_upgradeable(lines: Iterable[str]) -> Iterable[Tuple[... | 30.027027 | 96 | 0.569157 | import re
from typing import Iterable, Dict, Tuple, Union, Optional
from .abstract import Fact
from ..connectors.abstract import Executor
RE_UPGRADEABLE = r'([^\/]+)\/([^\s]+)\s+([^\s]+)\s+(\w+)\s+' \
r'\[upgradable from:\s+([^\s]+)\]$'
def parse_upgradeable(lines: Iterable[str]) -> Iterable[Tuple[... | true | true |
f7587fa934ce0f88736c571411779ee12fff9e33 | 341 | py | Python | myapi/resource_healthcheck.py | ChanReece/SoloProjectFalconAPI | 2006b4905d13ceedf9de307110ff634c82caafd6 | [
"MIT"
] | null | null | null | myapi/resource_healthcheck.py | ChanReece/SoloProjectFalconAPI | 2006b4905d13ceedf9de307110ff634c82caafd6 | [
"MIT"
] | null | null | null | myapi/resource_healthcheck.py | ChanReece/SoloProjectFalconAPI | 2006b4905d13ceedf9de307110ff634c82caafd6 | [
"MIT"
] | null | null | null | import json
import falcon
class HealthResource(object):
def on_get(self, req, resp):
"""Handles GET requests"""
response = {"status": "good"}
as_string = json.dumps(response)
# Set attributes of the Response which is sent to requestor
resp.body = as_string
resp.stat... | 26.230769 | 67 | 0.639296 | import json
import falcon
class HealthResource(object):
def on_get(self, req, resp):
response = {"status": "good"}
as_string = json.dumps(response)
resp.body = as_string
resp.status = falcon.HTTP_200
| true | true |
f7587faac0a2360efe05e6517cc09c07bb821534 | 29,995 | py | Python | src/transformers/configuration_utils.py | agemagician/transformers | 666220fc6417505607148ffb19d172d5732e860a | [
"Apache-2.0"
] | 2 | 2020-11-30T11:30:40.000Z | 2021-03-26T17:20:33.000Z | src/transformers/configuration_utils.py | agemagician/transformers | 666220fc6417505607148ffb19d172d5732e860a | [
"Apache-2.0"
] | 1 | 2020-11-12T11:00:12.000Z | 2020-11-12T11:00:12.000Z | src/transformers/configuration_utils.py | agemagician/transformers | 666220fc6417505607148ffb19d172d5732e860a | [
"Apache-2.0"
] | 1 | 2020-11-17T02:48:00.000Z | 2020-11-17T02:48:00.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 52.9947 | 153 | 0.647275 |
import copy
import json
import os
from typing import Any, Dict, Tuple
from .file_utils import CONFIG_NAME, cached_path, hf_bucket_url, is_remote_url
from .utils import logging
logger = logging.get_logger(__name__)
class PretrainedConfig(object):
model_type: str = ""
is_composition: bool = ... | true | true |
f75880965757445e2894554b5a1aeb7c22827b73 | 1,193 | py | Python | app/api/V1/__init__.py | eduhmik/Store-Manager-api | 50395d39758800784fbd0b3e516b8bedc900cdeb | [
"MIT"
] | null | null | null | app/api/V1/__init__.py | eduhmik/Store-Manager-api | 50395d39758800784fbd0b3e516b8bedc900cdeb | [
"MIT"
] | 8 | 2018-10-24T01:33:32.000Z | 2019-10-21T17:36:01.000Z | app/api/V1/__init__.py | eduhmik/Store-Manager-api | 50395d39758800784fbd0b3e516b8bedc900cdeb | [
"MIT"
] | 1 | 2018-10-19T21:57:48.000Z | 2018-10-19T21:57:48.000Z | from flask_restplus import Api
from flask import Blueprint
# Import all endpoints for all models
from .views.product_endpoints import api as product_namespace
from .views.sales_endpoints import api as sales_namespace
from .views.auth_endpoints import ns2 as userLogin_namespace
from .views.auth_endpoints import api a... | 39.766667 | 189 | 0.781224 | from flask_restplus import Api
from flask import Blueprint
from .views.product_endpoints import api as product_namespace
from .views.sales_endpoints import api as sales_namespace
from .views.auth_endpoints import ns2 as userLogin_namespace
from .views.auth_endpoints import api as userRegistration_namespace
from .v... | true | true |
f75881a65d2c8ce321aa87f9ca19b4fb453e1416 | 415 | py | Python | dev/import_excel.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | 2 | 2019-05-09T03:51:00.000Z | 2021-05-24T13:24:05.000Z | dev/import_excel.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | null | null | null | dev/import_excel.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | 1 | 2021-10-29T22:15:46.000Z | 2021-10-29T22:15:46.000Z | import pyexcel
from . import db
from .databases import SrsRecord, SrsTuple
def import_excel(filename, sheet_name):
for record in pyexcel.iget_records(file_name=filename, sheet_name=sheet_name):
if SrsRecord.query.filter_by(front=record['Front']).first() is None:
srs_record = SrsRecord(**SrsTu... | 29.642857 | 82 | 0.708434 | import pyexcel
from . import db
from .databases import SrsRecord, SrsTuple
def import_excel(filename, sheet_name):
for record in pyexcel.iget_records(file_name=filename, sheet_name=sheet_name):
if SrsRecord.query.filter_by(front=record['Front']).first() is None:
srs_record = SrsRecord(**SrsTu... | true | true |
f7588203fcdac1f0885a394335356883d4e52169 | 7,843 | py | Python | test/python/topology/test2_consistent_region_config.py | Jaimie-Jin1/streamsx.topology | 6f316ec8e9ed1349c6f061d9bb7d03deb87e3d08 | [
"Apache-2.0"
] | 31 | 2015-06-24T06:21:14.000Z | 2020-08-28T21:45:50.000Z | test/python/topology/test2_consistent_region_config.py | Jaimie-Jin1/streamsx.topology | 6f316ec8e9ed1349c6f061d9bb7d03deb87e3d08 | [
"Apache-2.0"
] | 1,203 | 2015-06-15T02:11:49.000Z | 2021-03-22T09:47:54.000Z | test/python/topology/test2_consistent_region_config.py | Jaimie-Jin1/streamsx.topology | 6f316ec8e9ed1349c6f061d9bb7d03deb87e3d08 | [
"Apache-2.0"
] | 53 | 2015-05-28T21:14:16.000Z | 2021-12-23T12:58:59.000Z | from streamsx.topology.topology import *
from streamsx.topology.state import ConsistentRegionConfig
import unittest
from datetime import timedelta
# Test the ConsistentRegionConfig class.
class TestConsistentRegionConfig(unittest.TestCase):
_DEFAULT_DRAIN_TIMEOUT = 180.0
_DEFAULT_RESET_TIMEOUT = 180.0
_DE... | 43.093407 | 118 | 0.729058 | from streamsx.topology.topology import *
from streamsx.topology.state import ConsistentRegionConfig
import unittest
from datetime import timedelta
class TestConsistentRegionConfig(unittest.TestCase):
_DEFAULT_DRAIN_TIMEOUT = 180.0
_DEFAULT_RESET_TIMEOUT = 180.0
_DEFAULT_ATTEMPTS = 5
def test_op_driv... | true | true |
f7588218086ff9488994abb0241c1311dd7c9aec | 23,842 | py | Python | statsmodels/tsa/vector_ar/irf.py | toobaz/statsmodels | 5286dd713a809b0630232508bf9ad5104aae1980 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T11:46:33.000Z | 2018-12-23T04:52:27.000Z | statsmodels/tsa/vector_ar/irf.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | statsmodels/tsa/vector_ar/irf.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | 3 | 2015-04-01T08:26:54.000Z | 2020-02-14T14:34:10.000Z | """
Impulse reponse-related code
"""
from __future__ import division
import numpy as np
import numpy.linalg as la
import scipy.linalg as L
from scipy import stats
from statsmodels.tools.decorators import cache_readonly
from statsmodels.tools.tools import chain_dot
#from statsmodels.tsa.api import VAR
import statsm... | 34.354467 | 118 | 0.529108 |
from __future__ import division
import numpy as np
import numpy.linalg as la
import scipy.linalg as L
from scipy import stats
from statsmodels.tools.decorators import cache_readonly
from statsmodels.tools.tools import chain_dot
import statsmodels.tsa.tsatools as tsa
import statsmodels.tsa.vector_ar.plotting as pl... | true | true |
f758824f5bb8d4258e4f9ffa6a13c9303f6b9a90 | 7,044 | py | Python | pyrex/seed.py | pyrex-coin/pyrex-python | 03872f839db305170b0f14e0101c33d46cc8476f | [
"BSD-3-Clause"
] | null | null | null | pyrex/seed.py | pyrex-coin/pyrex-python | 03872f839db305170b0f14e0101c33d46cc8476f | [
"BSD-3-Clause"
] | null | null | null | pyrex/seed.py | pyrex-coin/pyrex-python | 03872f839db305170b0f14e0101c33d46cc8476f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including withou... | 39.351955 | 126 | 0.658007 |
from pyrex import wordlists
from pyrex import ed25519
from pyrex import base58
from pyrex.address import address
from binascii import hexlify, unhexlify
from os import urandom
from sha3 import keccak_256
class Seed(object):
def __init__(self, phrase_or_hex="", wordlist="Englis... | true | true |
f75882bdac8453e2aaad9c07e3baa2eb1269dbd5 | 682 | py | Python | projects/migrations/0003_auto_20180403_2232.py | farispriadi/proman-python | e5b4d9238f1b769a89e6885ec8c923735db19563 | [
"MIT"
] | 55 | 2019-12-13T09:30:23.000Z | 2021-07-19T10:34:15.000Z | projects/migrations/0003_auto_20180403_2232.py | farispriadi/proman-python | e5b4d9238f1b769a89e6885ec8c923735db19563 | [
"MIT"
] | 7 | 2020-02-11T21:59:48.000Z | 2021-07-12T17:49:14.000Z | projects/migrations/0003_auto_20180403_2232.py | farispriadi/proman-python | e5b4d9238f1b769a89e6885ec8c923735db19563 | [
"MIT"
] | 40 | 2019-12-13T09:30:30.000Z | 2021-07-15T11:19:43.000Z | # Generated by Django 2.0.3 on 2018-04-04 01:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_auto_20180402_2041'),
]
operations = [
migrations.AlterField(
model_name='proj... | 27.28 | 104 | 0.6261 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_auto_20180402_2041'),
]
operations = [
migrations.AlterField(
model_name='project',
name='company',
f... | true | true |
f75882db6f36610a2b744ed2975b180df0458fbc | 1,099 | py | Python | colab/apps/voting/models.py | caseywstark/colab | e05293e45a657eda19d733bf05624a1613a7a9b7 | [
"MIT"
] | 1 | 2015-11-05T11:49:32.000Z | 2015-11-05T11:49:32.000Z | colab/apps/voting/models.py | caseywstark/colab | e05293e45a657eda19d733bf05624a1613a7a9b7 | [
"MIT"
] | null | null | null | colab/apps/voting/models.py | caseywstark/colab | e05293e45a657eda19d733bf05624a1613a7a9b7 | [
"MIT"
] | null | null | null | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.db import models
from voting.managers import VoteManager
SCORES = (
(u'+1', +1),
(u'-1', -1),
)
class Vote(models.Model):
"""
... | 28.179487 | 73 | 0.646952 | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User
from django.db import models
from voting.managers import VoteManager
SCORES = (
(u'+1', +1),
(u'-1', -1),
)
class Vote(models.Model):
user = ... | true | true |
f75882de0e0a3b46cd7df05193d7b8b344728673 | 1,379 | py | Python | data-structures/Starters PA1/check_brackets.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | data-structures/Starters PA1/check_brackets.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | data-structures/Starters PA1/check_brackets.py | richardson-souza/coursera-dsa | 0b77c5420b40efb80cded4405960baf75d6a334b | [
"MIT"
] | null | null | null | # python3
import sys
class Bracket:
def __init__(self, bracket_type, position):
self.bracket_type = bracket_type
self.position = position
def Match(self, c):
if self.bracket_type == '[' and c == ']':
return True
if self.bracket_type == '{' and c == '}':
... | 29.978261 | 85 | 0.499637 |
import sys
class Bracket:
def __init__(self, bracket_type, position):
self.bracket_type = bracket_type
self.position = position
def Match(self, c):
if self.bracket_type == '[' and c == ']':
return True
if self.bracket_type == '{' and c == '}':
... | true | true |
f7588340fa0788abf074db66287f0698e0b35484 | 5,956 | py | Python | FlaskApp/database_setup.py | robertavram/project5 | 12a2816b84be994b561f2f693cf34c0fa4f0ca19 | [
"Apache-2.0"
] | 7 | 2015-09-20T22:11:01.000Z | 2021-11-09T18:04:47.000Z | FlaskApp/database_setup.py | robertavram/project5 | 12a2816b84be994b561f2f693cf34c0fa4f0ca19 | [
"Apache-2.0"
] | 9 | 2020-03-24T15:24:59.000Z | 2022-03-11T23:13:00.000Z | FlaskApp/database_setup.py | robertavram/project5 | 12a2816b84be994b561f2f693cf34c0fa4f0ca19 | [
"Apache-2.0"
] | 2 | 2016-03-06T00:30:54.000Z | 2017-04-06T10:15:06.000Z | from sqlalchemy import Column, ForeignKey, Integer, String, TIMESTAMP, LargeBinary
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy import create_engine, func
import other_info
Base = declarative_base()
clas... | 28.634615 | 138 | 0.602586 | from sqlalchemy import Column, ForeignKey, Integer, String, TIMESTAMP, LargeBinary
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy import create_engine, func
import other_info
Base = declarative_base()
clas... | true | true |
f75883d618bc52eac9329f62b3d30338f7ecc32f | 310 | py | Python | .github/git_version.py | DasBasti/IndiaNavi_Firmware | 81d75ec775b574a400c9e0353ffdd29c671cce60 | [
"MIT"
] | 7 | 2021-05-28T08:15:24.000Z | 2021-07-09T15:21:50.000Z | .github/git_version.py | DasBasti/IndiaNavi_Firmware | 81d75ec775b574a400c9e0353ffdd29c671cce60 | [
"MIT"
] | null | null | null | .github/git_version.py | DasBasti/IndiaNavi_Firmware | 81d75ec775b574a400c9e0353ffdd29c671cce60 | [
"MIT"
] | 1 | 2021-06-18T08:45:13.000Z | 2021-06-18T08:45:13.000Z | import subprocess
import datetime
dt_date = datetime.datetime.now()
revision = (
subprocess.check_output(["git", "describe", "--abbrev=7", "--dirty", "--always", "--tags"])
.strip()
.decode("utf-8")
)
print("-DGIT_HASH='\"Version: %s built: %s\"'" % (revision, dt_date.strftime("%d %b %Y %H:%M"))) | 31 | 96 | 0.612903 | import subprocess
import datetime
dt_date = datetime.datetime.now()
revision = (
subprocess.check_output(["git", "describe", "--abbrev=7", "--dirty", "--always", "--tags"])
.strip()
.decode("utf-8")
)
print("-DGIT_HASH='\"Version: %s built: %s\"'" % (revision, dt_date.strftime("%d %b %Y %H:%M"))) | true | true |
f75884fd88d4d24436da1f213ad6c6b04570b89a | 851 | py | Python | edge_GitCommit.py | santarini/python | 8f1d576d59b7c9ca23c3d80058fa2d14833c54ae | [
"MIT"
] | 3 | 2017-12-22T09:33:18.000Z | 2020-07-06T04:53:00.000Z | edge_GitCommit.py | santarini/python | 8f1d576d59b7c9ca23c3d80058fa2d14833c54ae | [
"MIT"
] | null | null | null | edge_GitCommit.py | santarini/python | 8f1d576d59b7c9ca23c3d80058fa2d14833c54ae | [
"MIT"
] | null | null | null | import time
import datetime
import random
from selenium import webdriver
driver = webdriver.Edge('C:\Program Files\Python\MicrosoftWebDriver.exe')
driver.get('https://github.com/santarini/seleniumPushes/blob/master/pythonlog.md');
rand1 = random.uniform(3,10)
time.sleep(rand1)#arbitrary sleep time
page_body = driver.f... | 38.681818 | 83 | 0.772033 | import time
import datetime
import random
from selenium import webdriver
driver = webdriver.Edge('C:\Program Files\Python\MicrosoftWebDriver.exe')
driver.get('https://github.com/santarini/seleniumPushes/blob/master/pythonlog.md');
rand1 = random.uniform(3,10)
time.sleep(rand1)
page_body = driver.find_element_by_tag_na... | true | true |
f75885156726c855f24a287c18702c5bc9b5cba5 | 588 | py | Python | Geometry/HcalAlgo/python/testGeomHB_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 1 | 2018-07-25T03:57:34.000Z | 2018-07-25T03:57:34.000Z | Geometry/HcalAlgo/python/testGeomHB_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | Geometry/HcalAlgo/python/testGeomHB_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 2 | 2019-09-27T08:33:22.000Z | 2019-11-14T10:52:30.000Z | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/HcalCommonData/data/hcalrotations.xml',
'G... | 39.2 | 76 | 0.702381 | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/HcalCommonData/data/hcalrotations.xml',
'G... | true | true |
f75885baea76b312a7884a4534252f9791fafd1a | 267 | py | Python | example.py | Questionable-Research-Labs/NOERA | 0224c857df07c0b012ec057c496dfeb9909a0a84 | [
"MIT"
] | null | null | null | example.py | Questionable-Research-Labs/NOERA | 0224c857df07c0b012ec057c496dfeb9909a0a84 | [
"MIT"
] | null | null | null | example.py | Questionable-Research-Labs/NOERA | 0224c857df07c0b012ec057c496dfeb9909a0a84 | [
"MIT"
] | null | null | null | from OdrvWrapper.odrv_wrapper import Odrive_Arm
import random
print("Initialize")
arm = Odrive_Arm()
while True:
# Move to random point, this blocks the thread until the move is complete
arm.move_blocking( (random.random(),random.random(),random.random())) | 26.7 | 77 | 0.756554 | from OdrvWrapper.odrv_wrapper import Odrive_Arm
import random
print("Initialize")
arm = Odrive_Arm()
while True:
arm.move_blocking( (random.random(),random.random(),random.random())) | true | true |
f758871a2c74dcf25c5b0d7f81e465f7084b849e | 6,672 | py | Python | SNDG/Sequence/Assembly.py | ezequieljsosa/sndg-bio | 5f709b5b572564ec1dfa40d090eca9a34295743e | [
"MIT"
] | null | null | null | SNDG/Sequence/Assembly.py | ezequieljsosa/sndg-bio | 5f709b5b572564ec1dfa40d090eca9a34295743e | [
"MIT"
] | null | null | null | SNDG/Sequence/Assembly.py | ezequieljsosa/sndg-bio | 5f709b5b572564ec1dfa40d090eca9a34295743e | [
"MIT"
] | 1 | 2020-09-01T15:57:54.000Z | 2020-09-01T15:57:54.000Z | """
"""
import os
import shutil
from SNDG import execute, mkdir
import Bio.SeqIO as bpio
import multiprocessing
class Assembly:
SPADES_DOCKER_IMAGE = 'ezequieljsosa/spades'
@staticmethod
def assemble_pe(r1: str, r2: str, out: str, name: str , ss: str = None, trusted_contigs: str = None,
... | 44.48 | 157 | 0.557854 | import os
import shutil
from SNDG import execute, mkdir
import Bio.SeqIO as bpio
import multiprocessing
class Assembly:
SPADES_DOCKER_IMAGE = 'ezequieljsosa/spades'
@staticmethod
def assemble_pe(r1: str, r2: str, out: str, name: str , ss: str = None, trusted_contigs: str = None,
untrus... | true | true |
f758877877b55be5b882964cd025edb18b30bee4 | 31,250 | py | Python | prescient/engine/egret/egret_plugin.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | 1 | 2021-10-14T20:39:50.000Z | 2021-10-14T20:39:50.000Z | prescient/engine/egret/egret_plugin.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | null | null | null | prescient/engine/egret/egret_plugin.py | shrivats-pu/Prescient | 3d4238e98ddd767e2b81adc4091bb723dbf563d3 | [
"BSD-3-Clause"
] | null | null | null | # ___________________________________________________________________________
#
# Prescient
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
# This software is ... | 46.921922 | 147 | 0.639744 |
from __future__ import annotations
import os
import math
import logging
import datetime
import dateutil
from pyomo.environ import value, Suffix
from egret.common.log import logger as egret_logger
from egret.data.model_data import ModelData
from egret.parsers.prescient_dat_parser import get_uc_model, create_m... | true | true |
f758883322b50b4af838bf244c429874f32195a5 | 20,587 | py | Python | nautobot/ipam/tests/test_api.py | steffann/nautobot | f5cf4a294861e69fa10ac445f7fc89f432d5b3df | [
"Apache-2.0"
] | 1 | 2021-03-16T15:14:55.000Z | 2021-03-16T15:14:55.000Z | nautobot/ipam/tests/test_api.py | steffann/nautobot | f5cf4a294861e69fa10ac445f7fc89f432d5b3df | [
"Apache-2.0"
] | null | null | null | nautobot/ipam/tests/test_api.py | steffann/nautobot | f5cf4a294861e69fa10ac445f7fc89f432d5b3df | [
"Apache-2.0"
] | 1 | 2021-10-14T01:54:24.000Z | 2021-10-14T01:54:24.000Z | import json
from django.urls import reverse
from netaddr import IPNetwork
from rest_framework import status
from nautobot.dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
from nautobot.extras.models import Status
from nautobot.ipam.choices import *
from nautobot.ipam.models import (
Aggregate... | 34.084437 | 113 | 0.563802 | import json
from django.urls import reverse
from netaddr import IPNetwork
from rest_framework import status
from nautobot.dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
from nautobot.extras.models import Status
from nautobot.ipam.choices import *
from nautobot.ipam.models import (
Aggregate... | true | true |
f758885d9cf27353c92bd76a4683559edb8cf4af | 1,113 | py | Python | test/model/test_address.py | Trulioo/sdk-python | 3bf0530e2ba1a3ec93d89b967b2e257e7401d5c2 | [
"RSA-MD"
] | 1 | 2022-01-11T12:08:45.000Z | 2022-01-11T12:08:45.000Z | test/model/test_address.py | Trulioo/sdk-python | 3bf0530e2ba1a3ec93d89b967b2e257e7401d5c2 | [
"RSA-MD"
] | null | null | null | test/model/test_address.py | Trulioo/sdk-python | 3bf0530e2ba1a3ec93d89b967b2e257e7401d5c2 | [
"RSA-MD"
] | 1 | 2021-05-17T08:33:15.000Z | 2021-05-17T08:33:15.000Z | import unittest
from trulioo_sdk.model.address import Address
from trulioo_sdk.exceptions import ApiAttributeError, ApiTypeError
from trulioo_sdk.configuration import Configuration
class TestAddress(unittest.TestCase):
def test_address(self):
address = Address(
unit_number="123",
... | 28.538462 | 82 | 0.628032 | import unittest
from trulioo_sdk.model.address import Address
from trulioo_sdk.exceptions import ApiAttributeError, ApiTypeError
from trulioo_sdk.configuration import Configuration
class TestAddress(unittest.TestCase):
def test_address(self):
address = Address(
unit_number="123",
... | true | true |
f75888859c0cfed0e889a84bb162d512a567feff | 14,836 | py | Python | identify-imagery/nagap/identify-imagery-70s-90s.py | elischwat/hsfm-geomorph | ddd7cd8a5434d04fef9cab7f16f15e7efde868c8 | [
"MIT"
] | null | null | null | identify-imagery/nagap/identify-imagery-70s-90s.py | elischwat/hsfm-geomorph | ddd7cd8a5434d04fef9cab7f16f15e7efde868c8 | [
"MIT"
] | null | null | null | identify-imagery/nagap/identify-imagery-70s-90s.py | elischwat/hsfm-geomorph | ddd7cd8a5434d04fef9cab7f16f15e7efde868c8 | [
"MIT"
] | 1 | 2020-12-22T06:25:46.000Z | 2020-12-22T06:25:46.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
#... | 32.895787 | 164 | 0.700593 |
ib.pyplot as plt
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import contextily as ctx
import os
import cv2
import fiona
import geopandas as gpd
import re
import pandas as pd
gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
data_dir = '/data2/elilouis/hsfm-g... | true | true |
f7588a4b295e1222c1990c2f40eddbe9fd56575b | 4,371 | py | Python | lib/envs/blackjack.py | noahwoo/rl-sutton | 246d556fb3b05727d042254bdb7786d8c57ee5e5 | [
"MIT"
] | 2 | 2019-08-12T03:14:48.000Z | 2019-08-18T02:49:47.000Z | lib/envs/blackjack.py | noahwoo/rl-sutton | 246d556fb3b05727d042254bdb7786d8c57ee5e5 | [
"MIT"
] | null | null | null | lib/envs/blackjack.py | noahwoo/rl-sutton | 246d556fb3b05727d042254bdb7786d8c57ee5e5 | [
"MIT"
] | null | null | null | import gym
from gym import spaces
from gym.utils import seeding
def cmp(a, b):
return int((a > b)) - int((a < b))
# 1 = Ace, 2-10 = Number cards, Jack/Queen/King = 10
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
def draw_card(np_random):
return np_random.choice(deck)
def draw_hand(np_random):
# ... | 35.25 | 79 | 0.639442 | import gym
from gym import spaces
from gym.utils import seeding
def cmp(a, b):
return int((a > b)) - int((a < b))
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
def draw_card(np_random):
return np_random.choice(deck)
def draw_hand(np_random):
return [draw_card(np_random), draw_card(np_random... | true | true |
f7588bde7da83036be56b89325650c80f08b2203 | 2,358 | py | Python | source/tests/cdk_solution_helper/test_mappings.py | turnoutnow/maintaining-personalized-experiences-with-machine-learning | b45588c094734cce70198811890a28e65b8e39e1 | [
"Apache-2.0"
] | 1 | 2021-09-23T23:27:42.000Z | 2021-09-23T23:27:42.000Z | source/tests/cdk_solution_helper/test_mappings.py | turnoutnow/maintaining-personalized-experiences-with-machine-learning | b45588c094734cce70198811890a28e65b8e39e1 | [
"Apache-2.0"
] | null | null | null | source/tests/cdk_solution_helper/test_mappings.py | turnoutnow/maintaining-personalized-experiences-with-machine-learning | b45588c094734cce70198811890a28e65b8e39e1 | [
"Apache-2.0"
] | null | null | null | # ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 60.461538 | 120 | 0.45335 | true | true | |
f7588d44cb8da63378c4309c95ca342a22bf2406 | 172,392 | py | Python | languages/prs.py | kachelundmacher/edensahana | a02eb996d60f42e61c7e4678efff9fe584918358 | [
"MIT"
] | null | null | null | languages/prs.py | kachelundmacher/edensahana | a02eb996d60f42e61c7e4678efff9fe584918358 | [
"MIT"
] | null | null | null | languages/prs.py | kachelundmacher/edensahana | a02eb996d60f42e61c7e4678efff9fe584918358 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "یک موقعیت که منطقه جغرافیایی را برای این ساحه مشخص می کند. این یک موقعیت از سلسله موقعیت ها یا 'موقعیت ... | 54.58898 | 476 | 0.723189 |
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "یک موقعیت که منطقه جغرافیایی را برای این ساحه مشخص می کند. این یک موقعیت از سلسله موقعیت ها یا 'موقعیت گروپ' یا موقعیت است که ... | true | true |
f7588d71096d7276b2623b8b9ad49808a0c26462 | 9,741 | py | Python | nflfastpy/utils.py | jbf302/nflfastpy | c1e2365966e0f0f8efeb651be804d84caba57807 | [
"MIT"
] | 1 | 2021-09-23T19:00:01.000Z | 2021-09-23T19:00:01.000Z | nflfastpy/utils.py | jbf302/nflfastpy | c1e2365966e0f0f8efeb651be804d84caba57807 | [
"MIT"
] | null | null | null | nflfastpy/utils.py | jbf302/nflfastpy | c1e2365966e0f0f8efeb651be804d84caba57807 | [
"MIT"
] | null | null | null | import codecs
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None # default='warn'
def convert_to_gsis_id(new_id):
"""
Convert new player id columns to old gsis id
"""
if type(new_id) == float:
return new_id
return codecs.decode(new_id[4:-8].replace('-', ''), ... | 36.897727 | 175 | 0.6718 | import codecs
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
def convert_to_gsis_id(new_id):
if type(new_id) == float:
return new_id
return codecs.decode(new_id[4:-8].replace('-', ''), "hex").decode('utf-8')
def agg_stats(pbp, by_team=True):
list_of_teams = [... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.