hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7142cca0f48800d8b25507f5d1b79a5a49af070 | 245 | py | Python | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | simdata/hakata/script/dummy_db.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unisim import DB
class DummyDB(DB):
def connect(self):
pass
def disconnect(self):
pass
def init_table(self):
pass
def store(self, tick, objects):
pass
| 14.411765 | 35 | 0.526531 | from unisim import DB
class DummyDB(DB):
def connect(self):
pass
def disconnect(self):
pass
def init_table(self):
pass
def store(self, tick, objects):
pass
| true | true |
f7142d1dd2c3894eb628d06b70747641aac633ec | 7,231 | py | Python | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 7 | 2016-03-17T07:34:39.000Z | 2019-08-09T05:31:38.000Z | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 2 | 2015-01-18T03:35:14.000Z | 2017-03-27T18:11:41.000Z | paramunittest.py | rik0/ParamUnittest | e064fb382c6da355ae7242e79ea1bf14fb2b43e9 | [
"BSD-2-Clause"
] | 4 | 2015-10-23T07:42:31.000Z | 2021-01-15T02:28:11.000Z | # Copyright 2012 Enrico Franchi
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#... | 40.396648 | 89 | 0.603098 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import copy
import unittest
import collections
import importlib
__all__ = [
'parametrized',
'ParametrizedTestCase',
]
def _process_parameters(parameters_seq):
processed_parameters_seq = []
for parameters in parameters_seq:
... | true | true |
f7142e78dcfc85a5990b30355dbe0eeb484752fd | 1,454 | py | Python | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | download_data.py | EugenHotaj/ray-automl | f516c06f8c24559edac120941cd36e8720ecd228 | [
"MIT"
] | null | null | null | """Script to download and cache all data."""
import os
from typing import List
import openml
from automl import openml_utils
BENCHMARK_TASKS = {"adult": 7592, "nomao": 9977, "phoneme": 9952}
FOLD_COL = "fold"
def download_openml_tasks(task_ids: List[int]):
"""Downloads the given task_ids from OpenML and dumps... | 33.813953 | 88 | 0.672627 |
import os
from typing import List
import openml
from automl import openml_utils
BENCHMARK_TASKS = {"adult": 7592, "nomao": 9977, "phoneme": 9952}
FOLD_COL = "fold"
def download_openml_tasks(task_ids: List[int]):
tasks = openml.tasks.get_tasks(
task_ids, download_data=True, download_qualities=False
... | true | true |
f7142ea121c4efd6ef516ca222b10a3ea61550d2 | 3,746 | py | Python | data_loader.py | SmirnovKol/recurrent-visual-attention | 4cb8d9e768ae35f38439278bb8a7b4d6b253a537 | [
"MIT"
] | 463 | 2017-12-25T12:36:08.000Z | 2022-03-29T17:05:19.000Z | data_loader.py | Pandinosaurus/recurrent-visual-attention | a38ac8958ebf1c61a10c4d5320f1e31d3d0b73dd | [
"MIT"
] | 44 | 2018-01-16T08:41:36.000Z | 2021-12-17T06:23:13.000Z | data_loader.py | Pandinosaurus/recurrent-visual-attention | a38ac8958ebf1c61a10c4d5320f1e31d3d0b73dd | [
"MIT"
] | 135 | 2017-12-26T05:09:03.000Z | 2022-03-27T00:40:42.000Z | import numpy as np
from utils import plot_images
import torch
from torchvision import datasets
from torchvision import transforms
from torch.utils.data.sampler import SubsetRandomSampler
def get_train_valid_loader(
data_dir,
batch_size,
random_seed,
valid_size=0.1,
shuffle=True,
show_sample=F... | 30.704918 | 83 | 0.664976 | import numpy as np
from utils import plot_images
import torch
from torchvision import datasets
from torchvision import transforms
from torch.utils.data.sampler import SubsetRandomSampler
def get_train_valid_loader(
data_dir,
batch_size,
random_seed,
valid_size=0.1,
shuffle=True,
show_sample=F... | true | true |
f7142ff349e7ada53e51a9c796f37baacff04ec9 | 1,290 | py | Python | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | cl_progress/cl_progress.py | CORDEA/myPythonModules | 790674a8f155a94804242b9b220eb6ac6efc8328 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding:utf-8
#
# Copyright 2015-2017 Yoshihiro Tanaka
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 30 | 75 | 0.66124 |
__Author__ = "Yoshihiro Tanaka"
__date__ = "2015-02-02"
def progress(sent, flag):
import sys, commands
_SUC = '[SUCCEED]'
_FAL = '[FAILED]'
colors = {'clear': '\033[0m', 'red': '\033[31m', 'green': '\033[32m'}
width = int(commands.getoutput('stty size').split()[1])
if flag:
re... | true | true |
f71430b176a3802c19f4d2638a14ba0259909022 | 863 | py | Python | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | src/utils/osrm.py | sashakh/vroom-scripts | 46b8abce2d8680f5f854965cccf57ac7856fe092 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
DEFAULT_IP = '0.0.0.0'
DEFAULT_PORT = '5000'
def format_request(service,
locs,
ip = DEFAULT_IP,
port = DEFAULT_PORT):
req = 'http://' + ip + ':' + port + '/'
req += service + '/v1/car/'
for loc in ... | 23.324324 | 80 | 0.559676 | import requests
DEFAULT_IP = '0.0.0.0'
DEFAULT_PORT = '5000'
def format_request(service,
locs,
ip = DEFAULT_IP,
port = DEFAULT_PORT):
req = 'http://' + ip + ':' + port + '/'
req += service + '/v1/car/'
for loc in locs:
req += str(loc[0]) + ',' + str(l... | true | true |
f7143197fc3c82b21a8db9b00f7324492cb578fa | 1,210 | py | Python | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 49 | 2015-10-03T00:04:12.000Z | 2019-05-13T10:32:02.000Z | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 13 | 2015-10-07T21:15:23.000Z | 2019-02-09T17:12:46.000Z | src/prometheus_async/__init__.py | hynek/prometheus_async | 4abb25ac4f893c951131123989013df1286338d0 | [
"Apache-2.0"
] | 12 | 2015-10-15T23:05:03.000Z | 2019-02-09T15:49:07.000Z | # SPDX-License-Identifier: Apache-2.0
#
# Copyright 2016 Hynek Schlawack
#
# 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... | 25.744681 | 74 | 0.733058 |
__version__ = "22.3.0.dev0"
__title__ = "prometheus_async"
__description__ = (__doc__ or "").strip()
__uri__ = "https://prometheus-async.readthedocs.io/"
__author__ = "Hynek Schlawack"
__email__ = "hs@ox.cx"
__license__ = "Apache License, Version 2.0"
__copyright__ = f"Copyright (c) 2016 {__author__}"
from . im... | true | true |
f71431a16aaaf2c0f14e8c3eceaefa14bf68a0e5 | 5,134 | py | Python | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | scrolls/errors.py | a-bison/scrolls-py | cd531bd0755a107e79afc5bd8a23f0905e1fc120 | [
"BSD-3-Clause"
] | null | null | null | """
Errors not dependent on any specific Scrolls types.
Typically, you won't need to instantiate any of these yourself. The base exception
for _all_ Scrolls errors is `ScrollError`. Any error that occurs while validating
script syntax or interpreting scripts will inherit from `PositionalError`.
"""
import fun... | 28.681564 | 90 | 0.599533 |
import functools
import math
import typing as t
__all__ = (
"format_positional_error",
"ScrollError",
"PositionalError",
"ParseError",
"ParseEofError",
"ParseExpectError",
"TokenizeError",
"TokenizeEofError"
)
@functools.lru_cache(128)
def format_positional_error(
... | true | true |
f71431e0bae919d25b50e4bc0811e7098763a471 | 173 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 32 | 2018-05-01T05:24:43.000Z | 2022-03-11T23:20:39.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/broad_except.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | # pylint: disable=missing-docstring
from __future__ import print_function
__revision__ = 0
try:
__revision__ += 1
except Exception: # [broad-except]
print('error')
| 19.222222 | 37 | 0.739884 | from __future__ import print_function
__revision__ = 0
try:
__revision__ += 1
except Exception: print('error')
| true | true |
f71431e15f97613abc12e56b17caf9d892de3bd9 | 1,359 | py | Python | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | 2 | 2017-01-16T07:51:35.000Z | 2020-02-17T21:44:13.000Z | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | null | null | null | setup.py | butla/bravado-falcon | 2c377db486150a6e0b93a4fb5970be9cf3e769d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
from setuptools import setup
project_name = 'bravado-falcon'
version = '0.1.0'
setup_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(setup_dir, 'requirements.txt')) as req_file:
requirements = [lib.split('==')[0] for lib in req_file.readlines()]
with ... | 32.357143 | 71 | 0.65195 | import os.path
from setuptools import setup
project_name = 'bravado-falcon'
version = '0.1.0'
setup_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(setup_dir, 'requirements.txt')) as req_file:
requirements = [lib.split('==')[0] for lib in req_file.readlines()]
with open(os.path.join(setup_... | true | true |
f714330e3b625e83239ab4676720e506ac5de5a0 | 3,079 | py | Python | Lib/distutils/command/bdist_dumb.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | 3 | 2022-01-30T20:08:24.000Z | 2022-02-12T08:51:12.000Z | Lib/distutils/command/bdist_dumb.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/distutils/command/bdist_dumb.py | SaadBazaz/ChinesePython | 800955539dda912d4a1621bcf5a700aaaddc012f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
# created 2000/03/29, Greg Ward
__revision__ = "$Id: bdist_dumb.py,v 1.2 2002/04/12 09:44:05 sof34 Exp $"
import os
from distut... | 32.072917 | 77 | 0.559597 | """distutils.command.bdist_dumb
Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""
__revision__ = "$Id: bdist_dumb.py,v 1.2 2002/04/12 09:44:05 sof34 Exp $"
import os
from distutils.core import Command
from dis... | false | true |
f714331b5f57e69f93e8004c75487a73e41833cf | 1,224 | py | Python | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | config/urls.py | kdagley/publicrelations | dbf424c247028ed93881a5375b22d196cfeed175 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(templ... | 34.971429 | 91 | 0.693627 | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='pages/home.htm... | true | true |
f7143399b8cc53aab5eb6e9b11ef706b2984f99f | 14,667 | py | Python | deprecated/python/urllib/kalign_urllib2.py | SamFent/webservice-clients | b4c1ab0d4e0535cc8e79a0d5e731aaafef3193f2 | [
"Apache-2.0"
] | null | null | null | deprecated/python/urllib/kalign_urllib2.py | SamFent/webservice-clients | b4c1ab0d4e0535cc8e79a0d5e731aaafef3193f2 | [
"Apache-2.0"
] | null | null | null | deprecated/python/urllib/kalign_urllib2.py | SamFent/webservice-clients | b4c1ab0d4e0535cc8e79a0d5e731aaafef3193f2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# $Id: kalign_urllib2.py 2809 2015-03-13 16:10:25Z uludag $
# ======================================================================
#
# Copyright 2009-2018 EMBL - European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exce... | 36.57606 | 144 | 0.670348 |
import platform, os, re, sys, time, urllib, urllib2
from xmltramp2 import xmltramp
from optparse import OptionParser
baseUrl = 'http://www.ebi.ac.uk/Tools/services/rest/kalign'
checkInterval = 10
outputLevel = 1
debugLevel = 0
numOpts = len(sys.argv)
usage = "Usage: %prog [options...] [seqFile]"
description = """Ka... | false | true |
f714342388aea63bff603443250cc030b85ccfb7 | 7,152 | py | Python | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | specklepy/api/resources/branch.py | jsdbroughton/specklepy | 81a98ea938106001abae308e3cfe04a2c588f06a | [
"Apache-2.0"
] | null | null | null | from gql import gql
from specklepy.api.resource import ResourceBase
from specklepy.api.models import Branch
from specklepy.logging import metrics
NAME = "branch"
METHODS = ["create"]
class Resource(ResourceBase):
"""API Access class for branches"""
def __init__(self, account, basepath, client) -> None:
... | 32.958525 | 97 | 0.457634 | from gql import gql
from specklepy.api.resource import ResourceBase
from specklepy.api.models import Branch
from specklepy.logging import metrics
NAME = "branch"
METHODS = ["create"]
class Resource(ResourceBase):
def __init__(self, account, basepath, client) -> None:
super().__init__(
accoun... | true | true |
f71434b3c8211cc2ab644b5205326ec0c652e164 | 5,009 | py | Python | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | cnn/model_search.py | badrutdinovrr/darts | 434708e63cbda8f710d3c1810d06ad31c11db923 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... | 30.542683 | 128 | 0.643242 | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import *
from torch.autograd import Variable
from genotypes import PRIMITIVES
from genotypes import Genotype
class MixedOp(nn.Module):
def __init__(self, C, stride):
super(MixedOp, self).__init__()
self._ops = nn.ModuleList(... | true | true |
f71434c24f3b7959298b19af49f4893c651e600c | 2,465 | py | Python | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/adaptors/variationadaptor.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | from sqlalchemy.sql.expression import and_
from credoscript.mixins.base import paginate
class VariationAdaptor(object):
"""
"""
def __init__(self, dynamic=False, paginate=False, per_page=100):
self.query = Variation.query
self.dynamic = dynamic
self.paginate = paginate
self.... | 31.602564 | 109 | 0.643813 | from sqlalchemy.sql.expression import and_
from credoscript.mixins.base import paginate
class VariationAdaptor(object):
def __init__(self, dynamic=False, paginate=False, per_page=100):
self.query = Variation.query
self.dynamic = dynamic
self.paginate = paginate
self.per_page = per_p... | true | true |
f71435aefbab60525e1f6180d047b1c4a343f58a | 957 | py | Python | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | test/test_basic_software_asset_all_of.py | cons3rt/cons3rt-python-sdk | f0bcb295735ac55bbe47448fcbd95d2c7beb3ec0 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
CONS3RT Web API
A CONS3RT ReSTful API # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.mode... | 23.341463 | 107 | 0.726228 |
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.basic_software_asset_all_of import BasicSoftwareAssetAllOf from openapi_client.rest import ApiException
class TestBasicSoftwareAssetAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDo... | true | true |
f7143656ce4da10df1aaa3d84302fc6d8f3085ff | 4,728 | py | Python | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/build/test_coverage.py | Mehigh17/firecracker | 78c6b29f14f9e810c7426d935b5c4fbdfdfc4119 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests pertaining to line/branch test coverage for the Firecracker code base.
# TODO
- Put the coverage in `s3://spec.firecracker` and update it automatically.
target should be put in `s3://spec.firecra... | 32.833333 | 79 | 0.655245 |
import os
import platform
import re
import pytest
import framework.utils as utils
import host_tools.cargo_build as host
COVERAGE_TARGET_PCT = 84.53
COVERAGE_MAX_DELTA = 0.05
CARGO_KCOV_REL_PATH = os.path.join(host.CARGO_BUILD_REL_PATH, 'kcov')
KCOV_COVERAGE_FILE = 'index.js'
KCOV_COVERED_LINES_REGEX = r'"covere... | true | true |
f71436d10cc2c701fbdd2731e650a7b4d07afd22 | 6,393 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/cfat5005.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph c-fat500-5.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-... | 31.185366 | 94 | 0.672141 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def CFat5005(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
ret... | true | true |
f714374a1632476acaefbc832c81cdaf88352611 | 337 | py | Python | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | app.py | munrojm/api | 478eb7b7d65ee72c65c9c3a61aec02aed7aa5ffe | [
"BSD-3-Clause-LBNL"
] | null | null | null | import os
from monty.serialization import loadfn
from fastapi import FastAPI
import mp_api.xas.api
xas_store = os.environ.get("XAS_STORE", "xas_store.json")
xas_store = loadfn(xas_store)
xas_router = mp_api.xas.api.get_router(xas_store)
app = FastAPI(title="Materials Project API", version="3.0.0-dev")
app.include_ro... | 25.923077 | 65 | 0.789318 | import os
from monty.serialization import loadfn
from fastapi import FastAPI
import mp_api.xas.api
xas_store = os.environ.get("XAS_STORE", "xas_store.json")
xas_store = loadfn(xas_store)
xas_router = mp_api.xas.api.get_router(xas_store)
app = FastAPI(title="Materials Project API", version="3.0.0-dev")
app.include_ro... | true | true |
f7143796d07cbc04a71f65fa0722e8c7ea8bdc9a | 1,080 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | andrewmegaris/sdc_capstoner | e37393c93a9b01d1682a5e214acb8ad12417e6e2 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | andrewmegaris/sdc_capstoner | e37393c93a9b01d1682a5e214acb8ad12417e6e2 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | andrewmegaris/sdc_capstoner | e37393c93a9b01d1682a5e214acb8ad12417e6e2 | [
"MIT"
] | null | null | null | from styx_msgs.msg import TrafficLight
import cv2
from keras.models import load_model
from numpy import newaxis
import numpy as np
import tensorflow as tf
import os
class TLClassifier(object):
def __init__(self):
path = os.getcwd()
self.model = load_model(path + '/light_classification/model.h5')
self.m... | 30 | 80 | 0.661111 | from styx_msgs.msg import TrafficLight
import cv2
from keras.models import load_model
from numpy import newaxis
import numpy as np
import tensorflow as tf
import os
class TLClassifier(object):
def __init__(self):
path = os.getcwd()
self.model = load_model(path + '/light_classification/model.h5')
self.m... | false | true |
f714379ee3973b8021d36894d60ed8cb48ed5454 | 246 | py | Python | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista4/Q14.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | #Faça um programa que leia um vetor de 10 posições e verifique
#se existem valores iguais e os escreva na tela.
vetor=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
if n in vetor:
print(f"{n}")
vetor.append(n)
| 24.6 | 62 | 0.650407 | vetor=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
if n in vetor:
print(f"{n}")
vetor.append(n)
| true | true |
f71438eae2367cd2d781df2131122da34442181b | 27,609 | py | Python | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/test_block_device.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in... | 40.305109 | 78 | 0.604477 |
import contextlib
import mock
from oslo.serialization import jsonutils
from nova import block_device
from nova import context
from nova import test
from nova.tests.unit import fake_instance
from nova.tests.unit import matchers
from nova.virt import block_device as driver_block_device
from nova.virt import driver
fro... | true | true |
f71439ce9d32a0f70a4540340143a4985060ff8f | 8,950 | py | Python | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | algorithm/RL/DDPG.py | 915288938lx/Personae-master-01 | 0885c37956bd3f9157c66109e09755a51ad5d3a1 | [
"MIT"
] | null | null | null | # coding=utf-8
import tensorflow as tf
import numpy as np
import os
from algorithm import config
from base.env.market import Market
from checkpoints import CHECKPOINTS_DIR
from base.algorithm.model import BaseRLTFModel
from helper.args_parser import model_launcher_parser
from helper.data_logger import generate_algor... | 42.018779 | 142 | 0.557765 |
import tensorflow as tf
import numpy as np
import os
from algorithm import config
from base.env.market import Market
from checkpoints import CHECKPOINTS_DIR
from base.algorithm.model import BaseRLTFModel
from helper.args_parser import model_launcher_parser
from helper.data_logger import generate_algorithm_logger, ge... | true | true |
f7143a6df31b6e88eabff6f5aaf40943f677d15c | 6,824 | py | Python | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | pynotify/__init__.py | dhgrs/pynotify | 5bdfb0108466b7779f5bb7643b272c96f05c6f7c | [
"MIT"
] | null | null | null | import subprocess
class NotificationError(Exception):
pass
class BaseNotification:
def set_typed_variable(self, value, specified_type):
if isinstance(value, specified_type):
return value
else:
raise NotificationError(
'can only set '
f'... | 24.028169 | 75 | 0.592175 | import subprocess
class NotificationError(Exception):
pass
class BaseNotification:
def set_typed_variable(self, value, specified_type):
if isinstance(value, specified_type):
return value
else:
raise NotificationError(
'can only set '
f'... | true | true |
f7143a7938cf66264f124bc702bc410c903aa5bf | 147 | py | Python | FastAPISQLAlchamyGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | 29 | 2021-03-31T02:42:59.000Z | 2022-03-12T16:20:05.000Z | FastAPIMongoEngineGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | null | null | null | FastAPIMongoEngineGraphQL/app/mutations/__init__.py | scionoftech/FastAPI-Full-Stack-Samples | e7d42661ed59324ff20f419d05c6cd1e7dab7e97 | [
"MIT"
] | 4 | 2021-08-21T01:02:00.000Z | 2022-01-09T15:33:51.000Z | from .user import CreateUser, AuthUser, UpdateUser, DeleteUser, UpdatePassword
from .articles import CreateArticle, UpdateArticle, DeleteArticle
| 49 | 79 | 0.836735 | from .user import CreateUser, AuthUser, UpdateUser, DeleteUser, UpdatePassword
from .articles import CreateArticle, UpdateArticle, DeleteArticle
| true | true |
f7143afde7eec54cc467e2279b80d92472d6fb74 | 319 | py | Python | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | 3 | 2018-08-29T08:53:57.000Z | 2019-02-22T19:56:11.000Z | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | null | null | null | bitly_api/__init__.py | galeone/bitly-api-python | 162add496ba2b42675b36581178902cce516cdf7 | [
"Apache-2.0"
] | 1 | 2019-06-28T20:30:47.000Z | 2019-06-28T20:30:47.000Z | from .bitly_api import Connection, BitlyError, Error
__version__ = '0.3'
__author__ = "Jehiah Czebotar <jehiah@gmail.com>"
__all__ = ["Connection", "BitlyError", "Error"]
__doc__ = """
This is a python library for the bitly api
all methods raise BitlyError on an unexpected response, or a problem with input
format
"""
| 31.9 | 79 | 0.752351 | from .bitly_api import Connection, BitlyError, Error
__version__ = '0.3'
__author__ = "Jehiah Czebotar <jehiah@gmail.com>"
__all__ = ["Connection", "BitlyError", "Error"]
__doc__ = """
This is a python library for the bitly api
all methods raise BitlyError on an unexpected response, or a problem with input
format
"""
| true | true |
f7143b7edbae191e6924ad8021d9f11a2e53d982 | 2,262 | py | Python | src/oscar/apps/dashboard/app.py | abirafdirp/revania | 70272b842316e8df57b0bc8a0dc669c3af4ec8f9 | [
"BSD-3-Clause"
] | 2 | 2015-12-11T00:19:15.000Z | 2021-11-14T19:44:42.000Z | src/oscar/apps/dashboard/app.py | abirafdirp/revania | 70272b842316e8df57b0bc8a0dc669c3af4ec8f9 | [
"BSD-3-Clause"
] | null | null | null | src/oscar/apps/dashboard/app.py | abirafdirp/revania | 70272b842316e8df57b0bc8a0dc669c3af4ec8f9 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url, include
from oscar.core.application import Application
from oscar.core.loading import get_class
class DashboardApplication(Application):
name = 'dashboard'
permissions_map = {
'index': (['is_staff'], ['partner.dashboard_access']),
}
index_view = get_class('d... | 46.163265 | 73 | 0.665782 | from django.conf.urls import url, include
from oscar.core.application import Application
from oscar.core.loading import get_class
class DashboardApplication(Application):
name = 'dashboard'
permissions_map = {
'index': (['is_staff'], ['partner.dashboard_access']),
}
index_view = get_class('d... | true | true |
f7143dd95c98480c7753abe771970d9fae229904 | 20,780 | py | Python | pilosa/orm.py | philoprove/python-pilosa | c0edc8d0fe1687b9afd61c8bc4dd236b3c73fb78 | [
"BSD-3-Clause"
] | null | null | null | pilosa/orm.py | philoprove/python-pilosa | c0edc8d0fe1687b9afd61c8bc4dd236b3c73fb78 | [
"BSD-3-Clause"
] | null | null | null | pilosa/orm.py | philoprove/python-pilosa | c0edc8d0fe1687b9afd61c8bc4dd236b3c73fb78 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 Pilosa Corp.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2... | 36.392294 | 209 | 0.626853 |
import json
from .exceptions import PilosaError
from .validator import validate_index_name, validate_frame_name, validate_label
__all__ = ("TimeQuantum", "CacheType", "Schema", "Index", "PQLQuery", "PQLBatchQuery")
_TIME_FORMAT = "%Y-%m-%dT%H:%M"
class TimeQuantum:
NONE = None
YEAR = None
MONTH = Non... | true | true |
f7143e436422c57c3d9fcd782f05537d8d957896 | 6,211 | py | Python | MaxiNet/WorkerServer/p4_mininet.py | bramamurthy/P4SwitchesInMaxiNet | b7c941690d46b110b12469a9fb9c23de8e6b965f | [
"MIT"
] | 1 | 2018-05-09T16:57:03.000Z | 2018-05-09T16:57:03.000Z | MaxiNet/WorkerServer/p4_mininet.py | bramamurthy/P4SwitchesInMaxiNet | b7c941690d46b110b12469a9fb9c23de8e6b965f | [
"MIT"
] | null | null | null | MaxiNet/WorkerServer/p4_mininet.py | bramamurthy/P4SwitchesInMaxiNet | b7c941690d46b110b12469a9fb9c23de8e6b965f | [
"MIT"
] | null | null | null | # Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 35.289773 | 114 | 0.580583 |
from mininet.net import Mininet
from mininet.node import Switch, Host
from mininet.log import setLogLevel, info, error, debug
from mininet.moduledeps import pathCheck
from sys import exit
import os
import tempfile
import socket
from time import sleep
from netstat import check_listening_on_port
from parse_exp_cfg impo... | false | true |
f7143e71d4927605031e54ebefb2763f34929e39 | 9,923 | py | Python | old_code/YoutubeVideo.py | lukewest/Movie-Extra-Downloader | f5ba12a2f1a34fd4aa892eb0379342b131076a70 | [
"MIT"
] | 23 | 2018-08-08T14:28:59.000Z | 2022-03-22T15:45:10.000Z | old_code/YoutubeVideo.py | lukewest/Movie-Extra-Downloader | f5ba12a2f1a34fd4aa892eb0379342b131076a70 | [
"MIT"
] | 13 | 2018-08-08T14:50:29.000Z | 2022-01-27T09:05:18.000Z | old_code/YoutubeVideo.py | lukewest/Movie-Extra-Downloader | f5ba12a2f1a34fd4aa892eb0379342b131076a70 | [
"MIT"
] | 9 | 2018-08-12T14:08:15.000Z | 2021-09-18T01:08:04.000Z | from _socket import timeout
from urllib.error import URLError
from pytube import YouTube
from pytube.exceptions import RegexMatchError
from old_code.Stream import Stream
import time
import tools as tools
class YoutubeVideo(object):
# todo (2): subtitles
conn_errors = 0
def __init__(self, url, score=0, ... | 33.866894 | 102 | 0.550338 | from _socket import timeout
from urllib.error import URLError
from pytube import YouTube
from pytube.exceptions import RegexMatchError
from old_code.Stream import Stream
import time
import tools as tools
class YoutubeVideo(object):
conn_errors = 0
def __init__(self, url, score=0, preferred_container='m... | true | true |
f7143ea3ef7f254f2d3187ba1ded0afb09ea30ff | 23,487 | py | Python | tools/trainpar_deepqmri.py | fragrussu/qMRINet | 418cbe22cefa2974d8a97b359324ff4c35865d22 | [
"BSD-2-Clause"
] | 3 | 2020-10-22T23:37:36.000Z | 2022-02-18T09:39:42.000Z | tools/trainpar_deepqmri.py | fragrussu/qMRINet | 418cbe22cefa2974d8a97b359324ff4c35865d22 | [
"BSD-2-Clause"
] | null | null | null | tools/trainpar_deepqmri.py | fragrussu/qMRINet | 418cbe22cefa2974d8a97b359324ff4c35865d22 | [
"BSD-2-Clause"
] | null | null | null | # Author: Francesco Grussu, University College London
# <f.grussu@ucl.ac.uk> <francegrussu@gmail.com>
#
# Code released under BSD Two-Clause license
#
# Copyright (c) 2020 University College London.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are perm... | 60.689922 | 2,100 | 0.732788 |
import argparse, os, sys
from numpy import matlib
import numpy as np
import torch
from torch import nn
from torch import Tensor
from torch.utils.data import DataLoader
from torch import autograd
import pickle as pk
from pathlib import Path as pt
sys.path.insert(0, os.path.dirname(pt(__file__).absolute()) )
import deep... | true | true |
f71442b16a12f46a840756d2038ff554248234be | 9,869 | py | Python | ansible/lib/ansible/modules/core/cloud/google/gce_pd.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/cloud/google/gce_pd.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/cloud/google/gce_pd.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2013 Google Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 32.251634 | 95 | 0.616375 |
DOCUMENTATION = '''
---
module: gce_pd
version_added: "1.4"
short_description: utilize GCE persistent disk resources
description:
- This module can create and destroy unformatted GCE persistent disks
U(https://developers.google.com/compute/docs/disks#persistentdisks).
It also supports attaching and det... | true | true |
f71442ba66bcddc2b3b52f67bbd9823def89ad03 | 476 | py | Python | Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/Basics/Exercise/13_read_write_files/exercise_2_stocks.py | SDGraph/Hacktoberfest2k21 | 8f8aead15afa10ea12e1b23ece515a10a882de28 | [
"MIT"
] | null | null | null | Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/Basics/Exercise/13_read_write_files/exercise_2_stocks.py | SDGraph/Hacktoberfest2k21 | 8f8aead15afa10ea12e1b23ece515a10a882de28 | [
"MIT"
] | null | null | null | Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/Basics/Exercise/13_read_write_files/exercise_2_stocks.py | SDGraph/Hacktoberfest2k21 | 8f8aead15afa10ea12e1b23ece515a10a882de28 | [
"MIT"
] | null | null | null | with open("stocks.csv", "r") as f, open("output.csv", "w") as out:
out.write("Company Name,PE Ratio, PB Ratio\n")
next(f) # This will skip first line in the file which is a header
for line in f:
tokens = line.split(",")
stock = tokens[0]
price = float(tokens[1])
eps = float(... | 36.615385 | 70 | 0.546218 | with open("stocks.csv", "r") as f, open("output.csv", "w") as out:
out.write("Company Name,PE Ratio, PB Ratio\n")
next(f) for line in f:
tokens = line.split(",")
stock = tokens[0]
price = float(tokens[1])
eps = float(tokens[2])
book = float(tokens[3])
pe = ro... | true | true |
f71442ee9da45672024ed542f4f081204ce1ee75 | 4,356 | py | Python | redash/utils/parameterized_query.py | quanpower/redash | 2a37cb31d95703c239e1edf3d3d9e0f9c2eaf857 | [
"BSD-2-Clause"
] | 1 | 2021-01-20T18:57:12.000Z | 2021-01-20T18:57:12.000Z | redash/utils/parameterized_query.py | quanpower/redash | 2a37cb31d95703c239e1edf3d3d9e0f9c2eaf857 | [
"BSD-2-Clause"
] | null | null | null | redash/utils/parameterized_query.py | quanpower/redash | 2a37cb31d95703c239e1edf3d3d9e0f9c2eaf857 | [
"BSD-2-Clause"
] | null | null | null | import pystache
from functools import partial
from flask_login import current_user
from redash.authentication.org_resolving import current_org
from numbers import Number
from redash import models
from redash.utils import mustache_render, json_loads
from redash.permissions import require_access, view_only
from funcy imp... | 31.565217 | 125 | 0.672635 | import pystache
from functools import partial
from flask_login import current_user
from redash.authentication.org_resolving import current_org
from numbers import Number
from redash import models
from redash.utils import mustache_render, json_loads
from redash.permissions import require_access, view_only
from funcy imp... | true | true |
f7144329ccafee0fa6d6b0aae0ee85c8503eceb0 | 13,247 | py | Python | codigo/process_datos_abiertos.py | Morisset/Mexico-datos | 29d5ed1079732d5d809bc14eb5d3438662508728 | [
"MIT"
] | null | null | null | codigo/process_datos_abiertos.py | Morisset/Mexico-datos | 29d5ed1079732d5d809bc14eb5d3438662508728 | [
"MIT"
] | null | null | null | codigo/process_datos_abiertos.py | Morisset/Mexico-datos | 29d5ed1079732d5d809bc14eb5d3438662508728 | [
"MIT"
] | null | null | null | import os
import csv
import pandas as pd
import geopandas as gpd
from datetime import datetime, timedelta
## PROCESSING FUNCTIONS ##
def confirmados_diarios_por_estado(datos, entidades):
"""
Calcula el número total de casos confirmados por fecha y por estado.
Input:
- datos: datos abiertos de COVID-... | 35.802703 | 84 | 0.658111 | import os
import csv
import pandas as pd
import geopandas as gpd
from datetime import datetime, timedelta
def confirmados_diarios_por_estado(datos, entidades):
series = (datos[datos['RESULTADO'] == 1]
.groupby(['ENTIDAD_UM', 'FECHA_INGRESO'])
.count()['ORIGEN'])
return get_formato... | true | true |
f71443471e33b1d928697eb1bc2dc49d6db4519d | 14,277 | py | Python | lib/python3.8/site-packages/ansible_collections/community/network/plugins/modules/pn_trunk.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/community/network/plugins/modules/pn_trunk.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/community/network/plugins/modules/pn_trunk.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python
""" PN CLI trunk-create/trunk-delete/trunk-modify """
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at y... | 30.835853 | 81 | 0.62254 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: pn_trunk
author: "Pluribus Networks (@amitsi)"
short_description: CLI command to create/delete/modify a trunk.
deprecated:
removed_in: 2.0.0 # was Ansible 2.12
why: Doesn't support latest Plur... | true | true |
f7144496800e55420ec75dde8d365a87524ea74a | 37 | py | Python | rssdldmng/__init__.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | null | null | null | rssdldmng/__init__.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | 1 | 2019-11-25T15:54:02.000Z | 2019-11-25T15:54:02.000Z | rssdldmng/__init__.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | null | null | null | """Init file for RSS downloader."""
| 18.5 | 36 | 0.648649 | true | true | |
f71444d8f4c578982eaf1f4ddd50ab20ff8817b7 | 4,618 | py | Python | test/python/testconsole.py | malywonsz/txtai | ace1b04161062430887eb2153961abcd819a5afb | [
"Apache-2.0"
] | null | null | null | test/python/testconsole.py | malywonsz/txtai | ace1b04161062430887eb2153961abcd819a5afb | [
"Apache-2.0"
] | 47 | 2021-10-02T22:48:03.000Z | 2021-12-29T02:36:20.000Z | test/python/testconsole.py | malywonsz/txtai | ace1b04161062430887eb2153961abcd819a5afb | [
"Apache-2.0"
] | null | null | null | """
Console module tests
"""
import contextlib
import io
import os
import tempfile
import unittest
from txtai.console import Console
from txtai.embeddings import Embeddings
APPLICATION = """
path: %s
workflow:
test:
tasks:
- task: console
"""
class TestConsole(unittest.TestCase):
"""
Console... | 26.54023 | 109 | 0.591815 |
import contextlib
import io
import os
import tempfile
import unittest
from txtai.console import Console
from txtai.embeddings import Embeddings
APPLICATION = """
path: %s
workflow:
test:
tasks:
- task: console
"""
class TestConsole(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | true | true |
f7144505df291fdcf3ff246068f77eaa76ee3d0a | 7,859 | py | Python | django/apps/config.py | DrMeers/django | 83a3add4bed8d8d49f93b30c817c66908b0a26ba | [
"BSD-3-Clause"
] | 1 | 2019-02-10T19:33:27.000Z | 2019-02-10T19:33:27.000Z | django/apps/config.py | avkryukov/django | f90be002d9d3c10b87c74741986e2cbf9f2b858e | [
"BSD-3-Clause"
] | null | null | null | django/apps/config.py | avkryukov/django | f90be002d9d3c10b87c74741986e2cbf9f2b858e | [
"BSD-3-Clause"
] | null | null | null | from importlib import import_module
import os
from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import module_has_submodule
from django.utils._os import upath
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django application and its co... | 40.096939 | 81 | 0.618908 | from importlib import import_module
import os
from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import module_has_submodule
from django.utils._os import upath
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
def __init__(self, app_name, app_module):
... | true | true |
f7144537f8fc87d001f4ac40dde7224820902c65 | 632 | py | Python | django-server/climate_commander/jobs/migrations/0003_job_run_time.py | jrising/climate-commander | 123cf5a07b87eb1a3bdb44378ee27712b6563ec3 | [
"MIT"
] | null | null | null | django-server/climate_commander/jobs/migrations/0003_job_run_time.py | jrising/climate-commander | 123cf5a07b87eb1a3bdb44378ee27712b6563ec3 | [
"MIT"
] | 1 | 2016-08-03T21:49:58.000Z | 2016-08-03T21:49:58.000Z | django-server/climate_commander/jobs/migrations/0003_job_run_time.py | jrising/climate-commander | 123cf5a07b87eb1a3bdb44378ee27712b6563ec3 | [
"MIT"
] | 1 | 2016-07-13T18:19:56.000Z | 2016-07-13T18:19:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-19 05:37
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_remove_job_run_time'),
... | 26.333333 | 147 | 0.647152 | from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_remove_job_run_time'),
]
operations = [
migrations.AddField(
model_na... | true | true |
f714453f736bf7e39cc67b173d03bf9106ffd006 | 4,152 | py | Python | benchmark/startQiskit2375.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2375.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit2375.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=40
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.890756 | 140 | 0.651734 | import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
len... | true | true |
f7144556651053589116ff8ee6290dc79a7bff13 | 1,851 | py | Python | rdmo/questions/migrations/0038_rename_de_to_lang2.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 77 | 2016-08-09T11:40:20.000Z | 2022-03-06T11:03:26.000Z | rdmo/questions/migrations/0038_rename_de_to_lang2.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 377 | 2016-07-01T13:59:36.000Z | 2022-03-30T13:53:19.000Z | rdmo/questions/migrations/0038_rename_de_to_lang2.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | 47 | 2016-06-23T11:32:19.000Z | 2022-03-01T11:34:37.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-29 16:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('questions', '0037_rename_en_to_lang1'),
]
operations = [
migrations.RenameField(
... | 28.045455 | 49 | 0.553755 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('questions', '0037_rename_en_to_lang1'),
]
operations = [
migrations.RenameField(
model_name='catalog',
old_name='title_de',
... | true | true |
f71445882aac3e35cd2d41b9696c200ce10affe8 | 3,635 | py | Python | examples/paper_generation_code/2020-07-31-local_fmri_training_mouse.py | CoMind-Technologies/deepinterpolation | 2f583c4fdde4ed92139e40eb8076dd5b129d29d9 | [
"Unlicense"
] | 178 | 2020-10-16T19:51:21.000Z | 2022-03-11T01:25:22.000Z | examples/paper_generation_code/2020-07-31-local_fmri_training_mouse.py | CoMind-Technologies/deepinterpolation | 2f583c4fdde4ed92139e40eb8076dd5b129d29d9 | [
"Unlicense"
] | 46 | 2020-10-17T14:28:23.000Z | 2022-02-18T18:09:12.000Z | examples/paper_generation_code/2020-07-31-local_fmri_training_mouse.py | CoMind-Technologies/deepinterpolation | 2f583c4fdde4ed92139e40eb8076dd5b129d29d9 | [
"Unlicense"
] | 40 | 2020-10-18T19:01:27.000Z | 2022-03-17T15:49:54.000Z | import deepinterpolation as de
import sys
from shutil import copyfile
import os
from deepinterpolation.generic import JsonSaver, ClassLoader
import datetime
from typing import Any, Dict
now = datetime.datetime.now()
run_uid = now.strftime("%Y_%m_%d_%H_%M")
training_param = {}
generator_param = {}
network_param = {}
g... | 30.041322 | 148 | 0.784869 | import deepinterpolation as de
import sys
from shutil import copyfile
import os
from deepinterpolation.generic import JsonSaver, ClassLoader
import datetime
from typing import Any, Dict
now = datetime.datetime.now()
run_uid = now.strftime("%Y_%m_%d_%H_%M")
training_param = {}
generator_param = {}
network_param = {}
g... | true | true |
f71445884d094696a2b319a9793ec87601132945 | 1,030 | py | Python | code/Ex02.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | 8 | 2016-04-25T22:36:35.000Z | 2016-10-29T16:47:34.000Z | code/Ex02.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | null | null | null | code/Ex02.py | mariolpantunes/ml-deti | a47fdb5df70e3f6fda5768be14f97462dfe057fb | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import arff
import numpy as np
from sklearn import linear_model
# Load dataset
dataset = arff.load(open('dataset/dataset01.arff', 'r'))
data = np.array(dataset['data'])
# Reshape vector
X1 = data[:, 0].reshape(-1, 1)
X2 = np.multiply(X1, X1)
X = np.concatenate((X1, X2), axis=1)
Y = dat... | 23.409091 | 94 | 0.67767 | import matplotlib.pyplot as plt
import arff
import numpy as np
from sklearn import linear_model
dataset = arff.load(open('dataset/dataset01.arff', 'r'))
data = np.array(dataset['data'])
X1 = data[:, 0].reshape(-1, 1)
X2 = np.multiply(X1, X1)
X = np.concatenate((X1, X2), axis=1)
Y = data[:, 1].reshape(-1, 1)
plt.scat... | true | true |
f714468f5d55c957348c0992aa36ec674a65a747 | 291 | py | Python | test/test_fit.py | malyvsen/unifit | 4cd6eceb9fa0dda31a742bd34b22f70a80464bef | [
"MIT"
] | null | null | null | test/test_fit.py | malyvsen/unifit | 4cd6eceb9fa0dda31a742bd34b22f70a80464bef | [
"MIT"
] | null | null | null | test/test_fit.py | malyvsen/unifit | 4cd6eceb9fa0dda31a742bd34b22f70a80464bef | [
"MIT"
] | null | null | null | import scipy.stats
import unifit
class TestFit:
data = scipy.stats.cauchy.rvs(size=256)
def test_basic(self):
unifit.fit(self.data)
def test_unnamed(self):
unifit.fit(
self.data,
distributions=unifit.distributions.values()
)
| 16.166667 | 55 | 0.611684 | import scipy.stats
import unifit
class TestFit:
data = scipy.stats.cauchy.rvs(size=256)
def test_basic(self):
unifit.fit(self.data)
def test_unnamed(self):
unifit.fit(
self.data,
distributions=unifit.distributions.values()
)
| true | true |
f71446a08f9ffe05ef9b5e466dd97b0725d3771b | 60,170 | py | Python | nim.py | FauveNoir/allumette | e5b90aa795c1d4001e3bfcf88056a215337fd70e | [
"OML"
] | 1 | 2017-02-09T16:42:09.000Z | 2017-02-09T16:42:09.000Z | nim.py | FauveNoir/allumette | e5b90aa795c1d4001e3bfcf88056a215337fd70e | [
"OML"
] | null | null | null | nim.py | FauveNoir/allumette | e5b90aa795c1d4001e3bfcf88056a215337fd70e | [
"OML"
] | 3 | 2017-02-04T02:17:46.000Z | 2017-12-20T11:02:36.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import random
import sys
import time
import re
import copy
from optparse import OptionParser
import pygame
from pygame.locals import *
version = "0.1"
usage = "usage: %prog [ --lvl [0-5] | ]"
parser = OptionParser(usage=usage, version="%prog 0.1")
parser.add_o... | 38.76933 | 307 | 0.627372 |
import os
import random
import sys
import time
import re
import copy
from optparse import OptionParser
import pygame
from pygame.locals import *
version = "0.1"
usage = "usage: %prog [ --lvl [0-5] | ]"
parser = OptionParser(usage=usage, version="%prog 0.1")
parser.add_option("-m", help="Number of match"... | true | true |
f7144816b85989a438082526f2dc145b5a22fa38 | 470 | py | Python | animalid/random_id.py | Alphadelta14/animalid | 0b97a84ead34be2de623de1258aae16c4e8d83d2 | [
"MIT"
] | 5 | 2016-12-15T14:56:15.000Z | 2022-02-15T13:32:33.000Z | animalid/random_id.py | Alphadelta14/animalid | 0b97a84ead34be2de623de1258aae16c4e8d83d2 | [
"MIT"
] | 1 | 2016-10-06T17:37:39.000Z | 2016-10-06T17:37:39.000Z | animalid/random_id.py | Alphadelta14/animalid | 0b97a84ead34be2de623de1258aae16c4e8d83d2 | [
"MIT"
] | 1 | 2020-12-10T16:05:29.000Z | 2020-12-10T16:05:29.000Z | """Where the magic happens."""
import random
from animalid import alloys, animals, colors, fabrics, opinions, origins, shapes, sizes
FIRST_ADJECTIVES = opinions + shapes + sizes
SECOND_ADJECTIVES = alloys + colors + fabrics + origins
def generate_animal_id():
"""What it's all about."""
return "_".join(
... | 23.5 | 87 | 0.644681 | import random
from animalid import alloys, animals, colors, fabrics, opinions, origins, shapes, sizes
FIRST_ADJECTIVES = opinions + shapes + sizes
SECOND_ADJECTIVES = alloys + colors + fabrics + origins
def generate_animal_id():
return "_".join(
[
random.choice(FIRST_ADJECTIVES),
... | true | true |
f71448ef2c575cc60ec1ec5c6f6dc91a3603fb16 | 6,237 | py | Python | rcnn/lib/python3.6/site-packages/sphinx/make_mode.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | rcnn/lib/python3.6/site-packages/sphinx/make_mode.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | rcnn/lib/python3.6/site-packages/sphinx/make_mode.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.make_mode
~~~~~~~~~~~~~~~~
sphinx-build -M command-line handling.
This replaces the old, platform-dependent and once-generated content
of Makefile / make.bat.
This is in its own module so that importing it is fast. It should not
import the main Sphinx m... | 37.125 | 106 | 0.568062 | from __future__ import print_function
import os
import subprocess
import sys
from os import path
import sphinx
from sphinx import cmdline
from sphinx.util.console import color_terminal, nocolor, bold, blue from sphinx.util.osutil import cd, rmtree
if False:
from typing import List
proj_name = os.getenv('S... | true | true |
f7144910af197a90e026161df30c5200d7a0dd17 | 1,623 | py | Python | greengrass-v2/poll-api/artifacts/com.greengrass.FakeApi/1.0.0/app.py | dhwalters423/iot-reference-architectures | cb966fec51b73c4403744b0e8a6060f05fe92013 | [
"MIT-0"
] | 1 | 2022-01-20T12:26:42.000Z | 2022-01-20T12:26:42.000Z | greengrass-v2/poll-api/artifacts/com.greengrass.FakeApi/1.0.0/app.py | dhwalters423/iot-reference-architectures | cb966fec51b73c4403744b0e8a6060f05fe92013 | [
"MIT-0"
] | null | null | null | greengrass-v2/poll-api/artifacts/com.greengrass.FakeApi/1.0.0/app.py | dhwalters423/iot-reference-architectures | cb966fec51b73c4403744b0e8a6060f05fe92013 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
import json
import time
from random import gauss
from flask import Flask
number_of_devices = 10
number_of_values_per_second = 2
last_request = None
app = Flask(__name__)
@app.route('/')
def index():
return 'Server is running'
def get_time_ms():
return int(time.time() * 1000)
def... | 23.521739 | 95 | 0.557609 |
import json
import time
from random import gauss
from flask import Flask
number_of_devices = 10
number_of_values_per_second = 2
last_request = None
app = Flask(__name__)
@app.route('/')
def index():
return 'Server is running'
def get_time_ms():
return int(time.time() * 1000)
def generate_one_device(de... | true | true |
f714494bfe0ecac22c74155fa6c7a76f477af690 | 2,430 | py | Python | src/stats/intro_stats.py | JacobEkedahl/detect-intros-from-video | 9b2bac1c7209558711072f967a3359d2ca698cd4 | [
"MIT"
] | 5 | 2020-06-05T05:10:25.000Z | 2022-03-10T05:12:14.000Z | src/stats/intro_stats.py | JacobEkedahl/detect-intros-from-video | 9b2bac1c7209558711072f967a3359d2ca698cd4 | [
"MIT"
] | null | null | null | src/stats/intro_stats.py | JacobEkedahl/detect-intros-from-video | 9b2bac1c7209558711072f967a3359d2ca698cd4 | [
"MIT"
] | 3 | 2020-06-06T13:21:23.000Z | 2021-03-08T22:24:18.000Z | import matplotlib.pyplot as plt
import utils.extractor as extractor
import utils.file_handler as file_handler
import utils.time_handler as time_handler
def plot_intros():
intros = extractor.get_intros_from_data()
only_valid_intros = [x for x in intros if not x["end"] == "00:00:00"]
x_data = map(get_start... | 33.75 | 77 | 0.676955 | import matplotlib.pyplot as plt
import utils.extractor as extractor
import utils.file_handler as file_handler
import utils.time_handler as time_handler
def plot_intros():
intros = extractor.get_intros_from_data()
only_valid_intros = [x for x in intros if not x["end"] == "00:00:00"]
x_data = map(get_start... | true | true |
f7144a1dcf2877b5b9556bdaf5f3fa28830fe1f3 | 930 | py | Python | perfkitbenchmarker/linux_packages/libpng.py | xiaolihope/PerfKitBenchmarker-1.7.0 | 7699b1073a80d7a92fd3db93da742b93a2ecf900 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/libpng.py | xiaolihope/PerfKitBenchmarker-1.7.0 | 7699b1073a80d7a92fd3db93da742b93a2ecf900 | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/libpng.py | xiaolihope/PerfKitBenchmarker-1.7.0 | 7699b1073a80d7a92fd3db93da742b93a2ecf900 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.214286 | 74 | 0.754839 |
def YumInstall(vm):
vm.InstallPackages('libpng')
vm.InstallPackages('libpng-devel')
def AptInstall(vm):
vm.InstallPackages('libpng3 libpng12-dev')
| true | true |
f7144a6156a81fa3ee7667295196b9e059922910 | 1,860 | py | Python | tests/test_strings.py | idanmoradarthas/DataScienceUtils | be4806ebcb9ab0e2cdd189842227bd242f0c8910 | [
"MIT"
] | 19 | 2019-12-26T15:44:58.000Z | 2021-06-14T00:36:24.000Z | tests/test_strings.py | federicodecillia/DataScienceUtils | be4806ebcb9ab0e2cdd189842227bd242f0c8910 | [
"MIT"
] | 2 | 2019-12-06T12:32:41.000Z | 2020-11-27T11:54:15.000Z | tests/test_strings.py | federicodecillia/DataScienceUtils | be4806ebcb9ab0e2cdd189842227bd242f0c8910 | [
"MIT"
] | 3 | 2021-01-16T09:08:15.000Z | 2021-01-29T10:57:11.000Z | import pandas
from ds_utils.strings import append_tags_to_frame, extract_significant_terms_from_subset
def test_append_tags_to_frame():
x_train = pandas.DataFrame([{"article_name": "1", "article_tags": "ds,ml,dl"},
{"article_name": "2", "article_tags": "ds,ml"}])
x_test = pand... | 54.705882 | 115 | 0.64086 | import pandas
from ds_utils.strings import append_tags_to_frame, extract_significant_terms_from_subset
def test_append_tags_to_frame():
x_train = pandas.DataFrame([{"article_name": "1", "article_tags": "ds,ml,dl"},
{"article_name": "2", "article_tags": "ds,ml"}])
x_test = pand... | true | true |
f7144b8fa809f715ad4be47d6e7cdd7ba4be43fd | 63 | py | Python | caravaggio_rest_api/haystack/__init__.py | xalperte/django-caravaggio-rest-api | 36fcdc6b77982fc7fd2462f2c8997911f14047c4 | [
"MIT"
] | null | null | null | caravaggio_rest_api/haystack/__init__.py | xalperte/django-caravaggio-rest-api | 36fcdc6b77982fc7fd2462f2c8997911f14047c4 | [
"MIT"
] | null | null | null | caravaggio_rest_api/haystack/__init__.py | xalperte/django-caravaggio-rest-api | 36fcdc6b77982fc7fd2462f2c8997911f14047c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
# Copyright (c) 2018 PreSeries Tech, SL
| 21 | 39 | 0.619048 | true | true | |
f7144c3823d0412a188fb793a469ea4fa0b57caf | 139 | py | Python | examples/container.py | hugovk/Cyberbrain | 3b3789a7c23edf95c7f7bac94c2d165e9aaf86ed | [
"MIT"
] | 2,440 | 2019-09-21T04:21:55.000Z | 2022-03-30T09:47:47.000Z | examples/container.py | hugovk/Cyberbrain | 3b3789a7c23edf95c7f7bac94c2d165e9aaf86ed | [
"MIT"
] | 103 | 2019-09-21T15:19:59.000Z | 2022-03-28T06:27:40.000Z | examples/container.py | hugovk/Cyberbrain | 3b3789a7c23edf95c7f7bac94c2d165e9aaf86ed | [
"MIT"
] | 162 | 2019-07-16T08:03:18.000Z | 2022-03-30T02:51:21.000Z | from cyberbrain import trace
@trace
def container():
x = list(range(1000))
return x
if __name__ == "__main__":
container()
| 11.583333 | 28 | 0.647482 | from cyberbrain import trace
@trace
def container():
x = list(range(1000))
return x
if __name__ == "__main__":
container()
| true | true |
f7144d1cbcf7cf787868c444942d133284af243b | 7,461 | py | Python | lib/kubernetes/client/models/v1_lease_spec.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_lease_spec.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_lease_spec.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 31.217573 | 162 | 0.600456 |
from pprint import pformat
from six import iteritems
import re
class V1LeaseSpec(object):
swagger_types = {
'acquire_time': 'datetime',
'holder_identity': 'str',
'lease_duration_seconds': 'int',
'lease_transitions': 'int',
'renew_time': 'datetime'
... | true | true |
f7144fc6d2b714a04c1490bde3b0de182a0d41aa | 874 | py | Python | setup.py | estanislaoledesma/genper | 5996b8bc199d8cecc74b7f6d03b67a4c356b4beb | [
"MIT"
] | 2 | 2021-09-24T20:10:40.000Z | 2021-12-23T21:03:16.000Z | setup.py | estanislaoledesma/genper | 5996b8bc199d8cecc74b7f6d03b67a4c356b4beb | [
"MIT"
] | 4 | 2021-09-24T19:25:38.000Z | 2021-12-22T00:49:07.000Z | setup.py | estanislaoledesma/genper | 5996b8bc199d8cecc74b7f6d03b67a4c356b4beb | [
"MIT"
] | null | null | null | # coding: utf-8
import os
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file_... | 31.214286 | 79 | 0.663616 | import os
# README file and 2) it's easier to type in the README file than to put a raw
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
from setuptools import setup, find_packages
setup(
name = "genper",
version = "1.0.0",
author = "Estanislao Ledesma",
author_... | true | true |
f714504d98c7f4400644588df8c63bfbda6d348d | 6,903 | py | Python | spiketoolkit/validation/quality_metric_classes/parameter_dictionaries.py | seankmartin/spiketoolkit | 38261d95045b1cd689363579c10ab3aa0a1ab7c0 | [
"MIT"
] | null | null | null | spiketoolkit/validation/quality_metric_classes/parameter_dictionaries.py | seankmartin/spiketoolkit | 38261d95045b1cd689363579c10ab3aa0a1ab7c0 | [
"MIT"
] | null | null | null | spiketoolkit/validation/quality_metric_classes/parameter_dictionaries.py | seankmartin/spiketoolkit | 38261d95045b1cd689363579c10ab3aa0a1ab7c0 | [
"MIT"
] | null | null | null |
from collections import OrderedDict
recording_params_dict = OrderedDict([('apply_filter', True), ('freq_min',300.0), ('freq_max',6000.0)])
#Defining GUI Params
keys = list(recording_params_dict.keys())
types = [type(recording_params_dict[key]) for key in keys]
values = [recording_params_dict[key] for key in keys]
rec... | 56.121951 | 310 | 0.653774 |
from collections import OrderedDict
recording_params_dict = OrderedDict([('apply_filter', True), ('freq_min',300.0), ('freq_max',6000.0)])
keys = list(recording_params_dict.keys())
types = [type(recording_params_dict[key]) for key in keys]
values = [recording_params_dict[key] for key in keys]
recording_gui_params = [... | true | true |
f71450750ea8e5b04888fcc1b9d0708bbc947036 | 1,243 | py | Python | test/proj4/proj-regression-EPSG-3857-20.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 7 | 2019-03-19T09:32:41.000Z | 2022-02-07T13:20:33.000Z | test/proj4/proj-regression-EPSG-3857-20.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 2 | 2021-03-30T05:37:20.000Z | 2021-08-17T13:58:04.000Z | test/proj4/proj-regression-EPSG-3857-20.py | dvuckovic/magics-test | bd8baf97b0db986f6adf63700d3cf77bbcbad2f2 | [
"Apache-2.0"
] | 5 | 2019-03-19T10:43:46.000Z | 2021-09-09T14:28:39.000Z | from Magics.macro import *
import os
def plot_area(epsg, llx, lly, urx, ury):
img = os.path.basename(__file__).split('.')[0]
title = "Projection {} : [{:.2f}, {:.2f}, {:.2f}, {:.2f}]".format(epsg, llx, lly, urx, ury)
#Setting output
png = output(
output_formats = ['png'],
output_name ... | 28.906977 | 103 | 0.631537 | from Magics.macro import *
import os
def plot_area(epsg, llx, lly, urx, ury):
img = os.path.basename(__file__).split('.')[0]
title = "Projection {} : [{:.2f}, {:.2f}, {:.2f}, {:.2f}]".format(epsg, llx, lly, urx, ury)
png = output(
output_formats = ['png'],
output_name = img,
... | true | true |
f71451d02fba81b192946c47e4158536448a5bed | 40 | py | Python | test-django-project/testapp/urls.py | rhenter/django-utils | 7e2901ac1efc3db47977b98e45754e40bfef6891 | [
"MIT"
] | 20 | 2021-01-21T13:04:44.000Z | 2022-03-26T22:03:19.000Z | test-django-project/testapp/urls.py | rhenter/django-utils | 7e2901ac1efc3db47977b98e45754e40bfef6891 | [
"MIT"
] | 4 | 2019-03-15T18:13:49.000Z | 2019-03-20T00:06:46.000Z | test-django-project/testapp/urls.py | rhenter/django-utils | 7e2901ac1efc3db47977b98e45754e40bfef6891 | [
"MIT"
] | 6 | 2021-01-21T13:27:45.000Z | 2022-03-26T21:28:22.000Z |
app_name = 'testapp'
urlpatterns = [
]
| 8 | 20 | 0.65 |
app_name = 'testapp'
urlpatterns = [
]
| true | true |
f714526286c921b2969c494f081547696e8bff4f | 8,039 | py | Python | python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/dist_fleet_heter_pipeline_ctr.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 36.876147 | 85 | 0.559771 |
from __future__ import print_function
import shutil
import tempfile
import time
import paddle
import paddle.fluid as fluid
import os
import numpy as np
import ctr_dataset_reader
from test_dist_fleet_heter_base import runtime_main, FleetDistHeterRunnerBase
from dist_fleet_ctr import TestDistCTR2x2, fake_ctr_reader
... | true | true |
f714526e5dcd58db9ee80da6053783ce7e2a9594 | 1,916 | py | Python | src/restLayer/app/api_data_sci.py | ucsd-ccbb/Oncolist | a3c7ecde6f665a665873e5aa7be5bc3778f5b17e | [
"MIT"
] | null | null | null | src/restLayer/app/api_data_sci.py | ucsd-ccbb/Oncolist | a3c7ecde6f665a665873e5aa7be5bc3778f5b17e | [
"MIT"
] | null | null | null | src/restLayer/app/api_data_sci.py | ucsd-ccbb/Oncolist | a3c7ecde6f665a665873e5aa7be5bc3778f5b17e | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
import sys
import pymongo
import argparse
from bson import ObjectId
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
import bottle
from bottle import Bottle, redirect, request, response, static_file, request
from bson.json_util import dumps
import author... | 26.246575 | 88 | 0.694676 |
import sys
import pymongo
import argparse
from bson import ObjectId
from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
import bottle
from bottle import Bottle, redirect, request, response, static_file, request
from bson.json_util import dumps
import author_gene_clustering_module
... | false | true |
f71452cf2e938c16778cf2d6bdada38cde5b86ec | 716 | py | Python | tests/builder/model/test_model_builder.py | shfshf/deliverable_model | d1f34c4a719bd392033f3f9c9ccb2dbbcf6ec264 | [
"Apache-2.0"
] | null | null | null | tests/builder/model/test_model_builder.py | shfshf/deliverable_model | d1f34c4a719bd392033f3f9c9ccb2dbbcf6ec264 | [
"Apache-2.0"
] | null | null | null | tests/builder/model/test_model_builder.py | shfshf/deliverable_model | d1f34c4a719bd392033f3f9c9ccb2dbbcf6ec264 | [
"Apache-2.0"
] | null | null | null | import filecmp
from deliverable_model.builder.model.model_builder import ModelBuilder
def test_build(datadir, tmpdir):
model_builder = ModelBuilder()
model_builder.add_keras_h5_model(datadir / "fixture" / "keras_h5_model")
model_builder.save()
config = model_builder.serialize(tmpdir)
assert c... | 26.518519 | 76 | 0.702514 | import filecmp
from deliverable_model.builder.model.model_builder import ModelBuilder
def test_build(datadir, tmpdir):
model_builder = ModelBuilder()
model_builder.add_keras_h5_model(datadir / "fixture" / "keras_h5_model")
model_builder.save()
config = model_builder.serialize(tmpdir)
assert c... | true | true |
f71452f12de9bbaccc936c3a7641f37ccf59fe6e | 92,701 | py | Python | python/ccxt/ndax.py | allunderone/ccxt | b9e62462ad27a83ba6b0ec0ebd567357fdb7f2da | [
"MIT"
] | 1 | 2018-08-20T09:38:13.000Z | 2018-08-20T09:38:13.000Z | python/ccxt/ndax.py | allunderone/ccxt | b9e62462ad27a83ba6b0ec0ebd567357fdb7f2da | [
"MIT"
] | null | null | null | python/ccxt/ndax.py | allunderone/ccxt | b9e62462ad27a83ba6b0ec0ebd567357fdb7f2da | [
"MIT"
] | 1 | 2019-01-02T01:32:45.000Z | 2019-01-02T01:32:45.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 44.503601 | 218 | 0.51199 |
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import BadSymbol
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import OrderNotFound
from ccxt.base.decimal_to_precision import TI... | true | true |
f714530361b2ac4050c9c8318d7b66818f4b64c0 | 546 | py | Python | symposion/conference/admin.py | priyanshuraj7829/symposion | 6b522f1f798d53cf0a481ecbac002dc4d0b5ab2f | [
"BSD-3-Clause"
] | 147 | 2015-01-13T11:24:12.000Z | 2022-03-20T20:31:52.000Z | symposion/conference/admin.py | priyanshuraj7829/symposion | 6b522f1f798d53cf0a481ecbac002dc4d0b5ab2f | [
"BSD-3-Clause"
] | 758 | 2015-03-18T13:39:25.000Z | 2022-03-31T13:14:09.000Z | symposion/conference/admin.py | priyanshuraj7829/symposion | 6b522f1f798d53cf0a481ecbac002dc4d0b5ab2f | [
"BSD-3-Clause"
] | 83 | 2015-01-16T04:46:54.000Z | 2020-10-02T07:45:48.000Z | from django.contrib import admin
from symposion.conference.models import Conference, Section
class SectionInline(admin.TabularInline):
model = Section
prepopulated_fields = {"slug": ("name",)}
extra = 1
class ConferenceAdmin(admin.ModelAdmin):
list_display = ("title", "start_date", "end_date")
... | 23.73913 | 65 | 0.710623 | from django.contrib import admin
from symposion.conference.models import Conference, Section
class SectionInline(admin.TabularInline):
model = Section
prepopulated_fields = {"slug": ("name",)}
extra = 1
class ConferenceAdmin(admin.ModelAdmin):
list_display = ("title", "start_date", "end_date")
... | true | true |
f714542afbe3ce6340bb9e918a90bcd27446491c | 667 | py | Python | manage.py | mukhametdinovigor/where_to_go | 7374807a6b9bde3b0d2ec03f99f4c73718f7e63c | [
"MIT"
] | null | null | null | manage.py | mukhametdinovigor/where_to_go | 7374807a6b9bde3b0d2ec03f99f4c73718f7e63c | [
"MIT"
] | 2 | 2022-01-13T03:53:40.000Z | 2022-03-12T01:00:24.000Z | manage.py | mukhametdinovigor/where_to_go | 7374807a6b9bde3b0d2ec03f99f4c73718f7e63c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'where_to_go.settings')
try:
from django.core.management import execute_from_command_line
except ... | 29 | 75 | 0.68066 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'where_to_go.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f714546188fa61ae283a9f70bf3b94a702bd550e | 238 | py | Python | 2nd_minimum_no_list.py | Akshara2820/Python_Folder | 06782f88b45f907a4836e073c51f603bb19f9aa9 | [
"MIT"
] | null | null | null | 2nd_minimum_no_list.py | Akshara2820/Python_Folder | 06782f88b45f907a4836e073c51f603bb19f9aa9 | [
"MIT"
] | null | null | null | 2nd_minimum_no_list.py | Akshara2820/Python_Folder | 06782f88b45f907a4836e073c51f603bb19f9aa9 | [
"MIT"
] | null | null | null | num=[50,40,23,70,56,100,18,]
l=len(num)
a=0
mini1=num[a]
i=0
x=num
while i<l:
if x[i]<=mini1:
mini1=x[i]
i+=1
y=0
mini2=num[y]
a=0
c=num
m=0
while m<l:
if mini2>num[m]>mini1:
mini2=num[m]
m+=1
print(mini2)
| 11.333333 | 28 | 0.546218 | num=[50,40,23,70,56,100,18,]
l=len(num)
a=0
mini1=num[a]
i=0
x=num
while i<l:
if x[i]<=mini1:
mini1=x[i]
i+=1
y=0
mini2=num[y]
a=0
c=num
m=0
while m<l:
if mini2>num[m]>mini1:
mini2=num[m]
m+=1
print(mini2)
| true | true |
f71454f89dd5ee3d75234b5625c7636f0d8d8344 | 99 | py | Python | vecino/__init__.py | sniperkit/snk.fork.vecino | a140171795e68fb7c9e26a72a585bd6aeb4e35a9 | [
"Apache-2.0"
] | null | null | null | vecino/__init__.py | sniperkit/snk.fork.vecino | a140171795e68fb7c9e26a72a585bd6aeb4e35a9 | [
"Apache-2.0"
] | null | null | null | vecino/__init__.py | sniperkit/snk.fork.vecino | a140171795e68fb7c9e26a72a585bd6aeb4e35a9 | [
"Apache-2.0"
] | null | null | null | from vecino.similar_repositories import SimilarRepositories
from vecino.__main__ import initialize
| 33 | 59 | 0.89899 | from vecino.similar_repositories import SimilarRepositories
from vecino.__main__ import initialize
| true | true |
f7145511c4c4a602dc7d916f5a9d093870f5b3f0 | 40,188 | py | Python | research/object_detection/eval_util.py | slomrafgrav/models | daa6c0415e47bdc52ad6434dc2bdb5d8aeb4f7ce | [
"Apache-2.0"
] | 79 | 2019-03-02T17:40:25.000Z | 2021-08-17T13:22:03.000Z | research/object_detection/eval_util.py | ywy0318/models | 91a59c78e8c48e8a1b2fec37143e52dae3f066c1 | [
"Apache-2.0"
] | 8 | 2019-05-14T10:10:50.000Z | 2020-12-20T14:05:29.000Z | research/object_detection/eval_util.py | ywy0318/models | 91a59c78e8c48e8a1b2fec37143e52dae3f066c1 | [
"Apache-2.0"
] | 27 | 2019-02-04T01:45:48.000Z | 2021-03-18T02:39:28.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.259912 | 80 | 0.700956 | import collections
import os
import time
import numpy as np
import tensorflow as tf
from object_detection.core import box_list
from object_detection.core import box_list_ops
from object_detection.core import keypoint_ops
from object_detection.core import standard_fields as fields
from object_detection.metrics import ... | true | true |
f714557129b17004b2cb69261547461b88d0c20a | 227 | py | Python | rank_reset.py | AmanMulani/python_web_crawling | a36115db6548b98c2c66868a14ce752449f4f7d1 | [
"MIT"
] | null | null | null | rank_reset.py | AmanMulani/python_web_crawling | a36115db6548b98c2c66868a14ce752449f4f7d1 | [
"MIT"
] | null | null | null | rank_reset.py | AmanMulani/python_web_crawling | a36115db6548b98c2c66868a14ce752449f4f7d1 | [
"MIT"
] | null | null | null | import sqlite3
conn = sqlite3.connect('spider.sqlite')
cur = conn.cursor()
cur.execute('''
UPDATE Pages SET new_rank = 1.0, old_rank = 0.0
''')
conn.commit()
cur.close()
print('The rank of all pages has been set to 1.0') | 18.916667 | 51 | 0.678414 | import sqlite3
conn = sqlite3.connect('spider.sqlite')
cur = conn.cursor()
cur.execute('''
UPDATE Pages SET new_rank = 1.0, old_rank = 0.0
''')
conn.commit()
cur.close()
print('The rank of all pages has been set to 1.0') | true | true |
f71455c4fdf2d638a601f379ab38dd4ba96daa46 | 1,474 | py | Python | PythonClient/cv_mode.py | jelaredulla/thesis | dc348652cc0bd0a35e5d7506144d641510c2483b | [
"MIT"
] | null | null | null | PythonClient/cv_mode.py | jelaredulla/thesis | dc348652cc0bd0a35e5d7506144d641510c2483b | [
"MIT"
] | null | null | null | PythonClient/cv_mode.py | jelaredulla/thesis | dc348652cc0bd0a35e5d7506144d641510c2483b | [
"MIT"
] | null | null | null | # In settings.json first activate computer vision mode:
# https://github.com/Microsoft/AirSim/blob/master/docs/image_apis.md#computer-vision-mode
from AirSimClient import *
import pprint
pp = pprint.PrettyPrinter(indent=4)
client = CarClient()
client.confirmConnection()
for x in range(3): # do few times
z = x ... | 40.944444 | 147 | 0.687246 |
from AirSimClient import *
import pprint
pp = pprint.PrettyPrinter(indent=4)
client = CarClient()
client.confirmConnection()
for x in range(3): z = x * -20 - 5 client.simSetPose(Pose(Vector3r(z, z, z), AirSimClientBase.toQuaternion(x / 3.0, 0, x / 3.0)), True)
responses = client.simGetImages([
... | true | true |
f71455e0d19a2d1ec2ea85826d0070d6ac81fa73 | 5,361 | py | Python | corehq/messaging/tasks.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/messaging/tasks.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/messaging/tasks.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.apps.data_interfaces.models import AutomaticUpdateRule
from corehq.apps.sms import tasks as sms_tasks
from corehq.form_processor.exceptions import CaseNotFound
from corehq.form_processor.interfaces.dbaccessors import CaseAccessor... | 39.419118 | 102 | 0.76814 | from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.apps.data_interfaces.models import AutomaticUpdateRule
from corehq.apps.sms import tasks as sms_tasks
from corehq.form_processor.exceptions import CaseNotFound
from corehq.form_processor.interfaces.dbaccessors import CaseAccessor... | true | true |
f71456a563d2f1c851ebfeff59b72638c5277020 | 17,730 | py | Python | imageio_ffmpeg/_io.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | imageio_ffmpeg/_io.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | imageio_ffmpeg/_io.py | One-sixth/imageio-ffmpeg | 888dace44a2160395cd88c577d542fe820086aa0 | [
"BSD-2-Clause"
] | null | null | null | import sys
import time
import signal
import subprocess
from ._utils import get_ffmpeg_exe, logger
from ._parsing import LogCatcher, parse_ffmpeg_header, cvsecs
ISWIN = sys.platform.startswith("win")
exe = None
def _get_exe():
global exe
if exe is None:
exe = get_ffmpeg_exe()
return exe
def ... | 39.4 | 89 | 0.598759 | import sys
import time
import signal
import subprocess
from ._utils import get_ffmpeg_exe, logger
from ._parsing import LogCatcher, parse_ffmpeg_header, cvsecs
ISWIN = sys.platform.startswith("win")
exe = None
def _get_exe():
global exe
if exe is None:
exe = get_ffmpeg_exe()
return exe
def ... | true | true |
f71457963f04786f6d22ea632036dbc649cd5930 | 6,561 | py | Python | bbvSimMatrixGen.py | spencerhance/bbv-similarity-matrix | 0818c6b7e15c408ef261ac6b55a4cb2e6a2f3bfc | [
"MIT"
] | 1 | 2021-09-03T11:31:10.000Z | 2021-09-03T11:31:10.000Z | bbvSimMatrixGen.py | spencerhance/bbv-similarity-matrix | 0818c6b7e15c408ef261ac6b55a4cb2e6a2f3bfc | [
"MIT"
] | null | null | null | bbvSimMatrixGen.py | spencerhance/bbv-similarity-matrix | 0818c6b7e15c408ef261ac6b55a4cb2e6a2f3bfc | [
"MIT"
] | 1 | 2017-09-16T17:19:28.000Z | 2017-09-16T17:19:28.000Z | #!/usr/bin/env python
#Created by Spencer Hance and Trevor Gale on January 18th 2015
#Northeastern University Computer Architecture Research Group
#Licensed under MIT License
import sys
import matplotlib.pyplot as plt
import numpy as np
from pylab import cm
import re
import random
from scipy.misc import comb
import a... | 31.242857 | 91 | 0.641518 |
import sys
import matplotlib.pyplot as plt
import numpy as np
from pylab import cm
import re
import random
from scipy.misc import comb
import argparse
import warnings
def parseBBV(input_filename):
"""Parses a Basic Block Vector and converts data
into a Numpy array
"""
with open(input_filename, 'r') ... | false | true |
f714592c49e276e7f9b6598977e5a6108553973c | 1,014 | py | Python | django_admin_demo/urls.py | noahzaozao/django_admin_demo | 631010bb8cd14c8ccf48b46f154d78c2e7b5887a | [
"Apache-2.0"
] | null | null | null | django_admin_demo/urls.py | noahzaozao/django_admin_demo | 631010bb8cd14c8ccf48b46f154d78c2e7b5887a | [
"Apache-2.0"
] | null | null | null | django_admin_demo/urls.py | noahzaozao/django_admin_demo | 631010bb8cd14c8ccf48b46f154d78c2e7b5887a | [
"Apache-2.0"
] | null | null | null | """django_admin_demo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home'... | 36.214286 | 79 | 0.731755 | from django.conf.urls import url
from django.contrib import admin
from django.conf.urls.static import static
from django.conf import settings
from web.views import APIUserSearchView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'api/user/search', APIUserSearchView.as_view()),
] + static(settings.MED... | true | true |
f7145968a1bf58bef88ec9f77fbf6c48708480e2 | 1,067 | py | Python | wtools/plotting.py | DrAuxin/WestpaTools | 4e236e0a3d65504d1937260316a4a5c6f39aa610 | [
"BSD-3-Clause"
] | 1 | 2020-05-18T15:58:17.000Z | 2020-05-18T15:58:17.000Z | wtools/plotting.py | DrAuxin/WestpaTools | 4e236e0a3d65504d1937260316a4a5c6f39aa610 | [
"BSD-3-Clause"
] | null | null | null | wtools/plotting.py | DrAuxin/WestpaTools | 4e236e0a3d65504d1937260316a4a5c6f39aa610 | [
"BSD-3-Clause"
] | null | null | null | import h5py
import numpy
import matplotlib.pyplot as plt
def plotflux(h5file, state=1):
"""
A function that plots the dataset target_flux_evolution from a direct.h5 file.
Parameters
----------
h5file: dictionary
The user's HDF5 file loaded with loadh5.
state: integer
The target... | 26.675 | 85 | 0.615745 | import h5py
import numpy
import matplotlib.pyplot as plt
def plotflux(h5file, state=1):
fluxes = h5file['target_flux_evolution']['expected',:,state-1]
iterations = numpy.arange(1,len(fluxes)+1,1)
fig, ax = plt.subplots()
ax.plot(iterations,fluxes, linewidth=3)
ax.set_xlabel('WE Iteration', fontsize... | true | true |
f7145aa2447443687be6df3402e6c85c14e2707b | 15,668 | py | Python | experiments/custom_agents_opt.py | anonips/-MDP-Playground | 74431f98c210830a93a1bc83fcdcb95bf1644696 | [
"Apache-2.0"
] | 2 | 2019-09-18T14:43:40.000Z | 2021-02-23T18:46:50.000Z | experiments/custom_agents_opt.py | anonips/-MDP-Playground | 74431f98c210830a93a1bc83fcdcb95bf1644696 | [
"Apache-2.0"
] | null | null | null | experiments/custom_agents_opt.py | anonips/-MDP-Playground | 74431f98c210830a93a1bc83fcdcb95bf1644696 | [
"Apache-2.0"
] | 1 | 2020-02-14T13:59:15.000Z | 2020-02-14T13:59:15.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from ray.rllib.agents.trainer import Trainer, with_common_config
from ray.rllib.utils.annotations import override
# yapf: disable
# __sphinx_doc_begin__
class RandomAgent(Trainer):
"""P... | 44.511364 | 254 | 0.524509 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from ray.rllib.agents.trainer import Trainer, with_common_config
from ray.rllib.utils.annotations import override
class RandomAgent(Trainer):
_name = "RandomAgent"
_default_config ... | true | true |
f7145c199e0e4cfca77fa9ac99b9dea5fb703b95 | 1,756 | py | Python | alipay/aop/api/domain/AnswerModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AnswerModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AnswerModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AnswerModel(object):
def __init__(self):
self._extra = None
self._item_id = None
self._option_id = None
@property
def extra(self):
return se... | 24.732394 | 69 | 0.555809 | import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AnswerModel(object):
def __init__(self):
self._extra = None
self._item_id = None
self._option_id = None
@property
def extra(self):
return self._extra
@extra.setter
def extra(sel... | true | true |
f7145c94fe95283ff3e26d0aa9e1a5bdf965d2fc | 52,866 | py | Python | sdk/python/pulumi_azure_native/hybridnetwork/v20210501/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybridnetwork/v20210501/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybridnetwork/v20210501/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.239331 | 1,145 | 0.659668 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
__all__ = [
'CustomProfileResponse',
'DataDiskResponse',
'ImageReferenceResponse',
'LinuxConfigurationResponse... | true | true |
f7145cc12aed42e52b811d6e792bdbbe823aba63 | 9,103 | py | Python | rodnet/models/backbones/hgwi.py | zhengzangw/RODNet | eca5f2bd1f3051c2b823d279532ddafa71b009c1 | [
"MIT"
] | null | null | null | rodnet/models/backbones/hgwi.py | zhengzangw/RODNet | eca5f2bd1f3051c2b823d279532ddafa71b009c1 | [
"MIT"
] | null | null | null | rodnet/models/backbones/hgwi.py | zhengzangw/RODNet | eca5f2bd1f3051c2b823d279532ddafa71b009c1 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
class RadarStackedHourglass(nn.Module):
def __init__(self, n_class, stacked_num=1):
super(RadarStackedHourglass, self).__init__()
self.stacked_num = stacked_num
self.conv1a = nn.Conv3d(
in_channels=2,
out_channels=32,
k... | 34.612167 | 101 | 0.494782 | import torch
import torch.nn as nn
class RadarStackedHourglass(nn.Module):
def __init__(self, n_class, stacked_num=1):
super(RadarStackedHourglass, self).__init__()
self.stacked_num = stacked_num
self.conv1a = nn.Conv3d(
in_channels=2,
out_channels=32,
k... | true | true |
f7145d06775df411d8b6bbed45d9cb10c999cfeb | 203,536 | py | Python | salt/modules/file.py | sacren/salt | 887336c6deaaad6f9ad4948b69472bd043962d56 | [
"Apache-2.0"
] | null | null | null | salt/modules/file.py | sacren/salt | 887336c6deaaad6f9ad4948b69472bd043962d56 | [
"Apache-2.0"
] | null | null | null | salt/modules/file.py | sacren/salt | 887336c6deaaad6f9ad4948b69472bd043962d56 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage information about regular files, directories,
and special files on the minion, set/read user,
group, mode, and data
'''
# TODO: We should add the capability to do u+r type operations here
# some time in the future
from __future__ import absolute_import, print_function
# Import pyth... | 31.932225 | 178 | 0.555337 |
from __future__ import absolute_import, print_function
import datetime
import difflib
import errno
import fileinput
import fnmatch
import itertools
import logging
import operator
import os
import re
import shutil
import stat
import string
import sys
import tempfile
import time
import glob
import hashlib
import mmap
... | true | true |
f7145d3436320d6def2071605cdc3fc5a509c911 | 2,682 | py | Python | catalog/bindings/gmd/cubic_spline_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/cubic_spline_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/cubic_spline_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from bindings.gmd.point_property import Point... | 28.83871 | 77 | 0.561894 | from dataclasses import dataclass, field
from typing import List, Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from bindings.gmd.point_property import Point... | true | true |
f7145dbe062462ea587231c7a6d56ded0ad5f8e1 | 323 | py | Python | examples/02_Example_WaterwaySearch/TerminalColors.py | jaywilhelm/OpenUxAS | 76b08d94c4c51ca51d9f79c9db03d7344e9d6552 | [
"NASA-1.3"
] | 13 | 2019-09-19T01:07:23.000Z | 2022-01-06T17:25:48.000Z | src/TerminalColors.py | JTEnglish/UAVHeading-CollisionAvoidance | 97e732616b6243184d64455e143ffe798840273a | [
"MIT"
] | 3 | 2019-06-10T06:10:52.000Z | 2020-07-21T16:10:41.000Z | src/TerminalColors.py | JTEnglish/UAVHeading-CollisionAvoidance | 97e732616b6243184d64455e143ffe798840273a | [
"MIT"
] | 3 | 2020-02-12T06:13:36.000Z | 2021-02-14T03:00:34.000Z | '''
Class: TerminalColors
Credit: https://stackoverflow.com/questions/287871/print-in-terminal-with-colors
'''
class TerminalColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[... | 23.071429 | 81 | 0.609907 |
class TerminalColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m' | true | true |
f7145e9a3b17f8a481672804c82a177d305100f7 | 3,194 | py | Python | pictures/tests.py | David5627/My_Gallary | cfbdcb13586f3d132993f9ceb1aa84c2f0ca61b3 | [
"MIT"
] | null | null | null | pictures/tests.py | David5627/My_Gallary | cfbdcb13586f3d132993f9ceb1aa84c2f0ca61b3 | [
"MIT"
] | null | null | null | pictures/tests.py | David5627/My_Gallary | cfbdcb13586f3d132993f9ceb1aa84c2f0ca61b3 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
from .models import Image, Category, Location
class TestImage(TestCase):
def setUp(self):
self.location = Location(locationName='Kiambu')
self.location.saveLocation()
self.category = Category(categoryName='job')
self.cate... | 32.591837 | 123 | 0.66938 | from django.test import TestCase
from .models import Image, Category, Location
class TestImage(TestCase):
def setUp(self):
self.location = Location(locationName='Kiambu')
self.location.saveLocation()
self.category = Category(categoryName='job')
self.category.saveCategory()
... | true | true |
f7145f89446bea1ed70f31be8e13fd069d3d268f | 16,419 | py | Python | venv/lib/python2.7/site-packages/sklearn/base.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | null | null | null | venv/lib/python2.7/site-packages/sklearn/base.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | null | null | null | venv/lib/python2.7/site-packages/sklearn/base.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | 1 | 2020-07-23T19:26:19.000Z | 2020-07-23T19:26:19.000Z | """Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import inspect
import warnings
import numpy as np
from scipy import sparse
from .externals import six
###############################################################################
de... | 36.006579 | 79 | 0.554053 |
import copy
import inspect
import warnings
import numpy as np
from scipy import sparse
from .externals import six
def clone(estimator, safe=True):
estimator_type = type(estimator)
if estimator_type in (list, tuple, set, frozenset):
return estimator_type([clone(e, safe=safe) for e in estimator])
... | true | true |
f7145fcd7c7022a6a463fb955a8d7559d8d3a21d | 64,450 | py | Python | amd64-linux/lib/python/update_config.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | 1 | 2020-06-15T10:41:18.000Z | 2020-06-15T10:41:18.000Z | amd64-linux/lib/python/update_config.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | null | null | null | amd64-linux/lib/python/update_config.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | 3 | 2020-08-10T10:25:02.000Z | 2021-09-12T01:12:09.000Z | from sim_core import *
import conf
import sim
# dictionary with list of update functions to call
update_functions = {}
def install_configuration_update(version, f):
prev = update_functions.get(version, [])
update_functions[version] = prev + [f]
def update_configuration(set):
global first_queue
try:
... | 38.919082 | 114 | 0.617797 | from sim_core import *
import conf
import sim
update_functions = {}
def install_configuration_update(version, f):
prev = update_functions.get(version, [])
update_functions[version] = prev + [f]
def update_configuration(set):
global first_queue
try:
if set['sim'].version > conf.sim.version:
... | false | true |
f71461118a36638bf9f86bc877bea372a4e45f9a | 689 | py | Python | app.py | JoeDReynolds/HW_13 | 8fc15c37554069ff51e1d29685384e6e521a4b2a | [
"ADSL"
] | null | null | null | app.py | JoeDReynolds/HW_13 | 8fc15c37554069ff51e1d29685384e6e521a4b2a | [
"ADSL"
] | null | null | null | app.py | JoeDReynolds/HW_13 | 8fc15c37554069ff51e1d29685384e6e521a4b2a | [
"ADSL"
] | null | null | null | # import necessary libraries
from flask import Flask, render_template, jsonify, redirect
from flask_pymongo import PyMongo
import scrape_mars
# create instance of Flask app
app = Flask(__name__)
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
# create route that renders index.ht... | 23.758621 | 62 | 0.740203 | from flask import Flask, render_template, jsonify, redirect
from flask_pymongo import PyMongo
import scrape_mars
app = Flask(__name__)
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
@app.route("/")
def index():
mars_data = mongo.db.mars_db.find_one()
return render_template("i... | true | true |
f71461fff2ddfcf30af051a048b0f75af416145e | 3,596 | py | Python | ma.py | nishishailesh/moving_average_clin_lab | c8ee448ca16b0d3845c42cafa070dafd307594dc | [
"MIT"
] | null | null | null | ma.py | nishishailesh/moving_average_clin_lab | c8ee448ca16b0d3845c42cafa070dafd307594dc | [
"MIT"
] | null | null | null | ma.py | nishishailesh/moving_average_clin_lab | c8ee448ca16b0d3845c42cafa070dafd307594dc | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import fcntl
import logging
import time
import io
import datetime
import decimal
import statistics
from astm_bidirectional_common import my_sql , file_mgmt, print_to_log
#For mysql password
sys.path.append('/var/gmcs_config')
import astm_var
####Settings section start#####
logfile_name='/... | 35.60396 | 128 | 0.743326 | import sys
import fcntl
import logging
import time
import io
import datetime
import decimal
import statistics
from astm_bidirectional_common import my_sql , file_mgmt, print_to_log
sys.path.append('/var/gmcs_config')
import astm_var
logfile_name='/var/log/ma.log'
log=1
n_size=50
last_sample_id_dict={}
logging.basicCo... | true | true |
f7146227c802ba11eb67d4ee45f43ada79d84b3d | 3,553 | py | Python | app/selenium_ui/jsm/pages/customer_selectors.py | mapit-plugin/dc-app-performance-toolkit | 75d7562c7ffc925c8ba8dfbe81db08af85fadcfa | [
"Apache-2.0"
] | 1 | 2021-09-17T04:34:03.000Z | 2021-09-17T04:34:03.000Z | app/selenium_ui/jsm/pages/customer_selectors.py | mapit-plugin/dc-app-performance-toolkit | 75d7562c7ffc925c8ba8dfbe81db08af85fadcfa | [
"Apache-2.0"
] | null | null | null | app/selenium_ui/jsm/pages/customer_selectors.py | mapit-plugin/dc-app-performance-toolkit | 75d7562c7ffc925c8ba8dfbe81db08af85fadcfa | [
"Apache-2.0"
] | 1 | 2020-12-30T11:12:58.000Z | 2020-12-30T11:12:58.000Z | from util.conf import JSM_SETTINGS
from selenium.webdriver.common.by import By
class UrlManager:
def __init__(self, portal_id=None, request_key=None):
self.host = JSM_SETTINGS.server_url
self.login_params = '/servicedesk/customer/user/login'
self.portal_params = f'/servicedesk/customer/po... | 39.921348 | 111 | 0.710104 | from util.conf import JSM_SETTINGS
from selenium.webdriver.common.by import By
class UrlManager:
def __init__(self, portal_id=None, request_key=None):
self.host = JSM_SETTINGS.server_url
self.login_params = '/servicedesk/customer/user/login'
self.portal_params = f'/servicedesk/customer/po... | true | true |
f71462edb7ac3e4f02fba779f9139da6a78624ba | 6,058 | py | Python | tests/evaluators_test.py | gaussalgo/adaptor | 8d8ae1b7694108f4bde78c127fe9ff97fa6b9470 | [
"MIT"
] | 11 | 2022-01-25T13:44:15.000Z | 2022-03-16T12:46:58.000Z | tests/evaluators_test.py | gaussalgo/adaptor | 8d8ae1b7694108f4bde78c127fe9ff97fa6b9470 | [
"MIT"
] | 3 | 2022-01-29T18:19:01.000Z | 2022-02-01T15:34:44.000Z | tests/evaluators_test.py | gaussalgo/adaptor | 8d8ae1b7694108f4bde78c127fe9ff97fa6b9470 | [
"MIT"
] | 1 | 2022-02-17T17:11:40.000Z | 2022-02-17T17:11:40.000Z | from adaptor.evaluators.generative import GenerativeEvaluator
from adaptor.evaluators.sequence_classification import SeqClassificationEvaluator
from adaptor.evaluators.token_classification import TokenClassificationEvaluator
from adaptor.lang_module import LangModule
from adaptor.objectives.objective_base import Object... | 44.544118 | 113 | 0.680753 | from adaptor.evaluators.generative import GenerativeEvaluator
from adaptor.evaluators.sequence_classification import SeqClassificationEvaluator
from adaptor.evaluators.token_classification import TokenClassificationEvaluator
from adaptor.lang_module import LangModule
from adaptor.objectives.objective_base import Object... | true | true |
f71463ad03d8ae030b29ae38adf10fb001e335fc | 6,524 | py | Python | code/database/project.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | code/database/project.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | code/database/project.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------------------
# project.py
#
# Author : Felix Gonda
# Date : July 10, 2015
# School : Harvard University
#
# Project : Master Thesis
# An Interactive Deep Learning Toolkit for
# Automatic Segmentation of Images
#
# S... | 36.858757 | 92 | 0.51962 |
import os
import sqlite3 as lite
import sys
import json
import glob
import time
import uuid
from datetime import datetime, date
base_path = os.path.dirname(__file__)
sys.path.insert(1,os.path.join(base_path, '../common'))
from utility import Utility
from paths import Paths
from label import Label
from image import I... | false | true |
f714644c0e16e7716dae2a067aae906a9e263d99 | 23,086 | py | Python | script_helper/Script/Network.py | jupiterman/Data-Transfer-Neural-Way | a38140aab141e4749aedc30899714ad4028a6a8a | [
"Apache-2.0"
] | 1 | 2020-02-17T06:38:58.000Z | 2020-02-17T06:38:58.000Z | script_helper/Script/Network.py | minihat/Neural-Style-Transfer | d900a5552c78f81450c3918640aa3e9210a57488 | [
"Apache-2.0"
] | null | null | null | script_helper/Script/Network.py | minihat/Neural-Style-Transfer | d900a5552c78f81450c3918640aa3e9210a57488 | [
"Apache-2.0"
] | 1 | 2018-02-07T12:59:04.000Z | 2018-02-07T12:59:04.000Z | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from scipy.misc import imread, imresize, imsave, fromimage, toimage
from scipy.optimize import fmin_l_bfgs_b
import numpy as np
import time
import argparse
import warnings
from keras.models import Model
from k... | 36.878594 | 152 | 0.668067 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from scipy.misc import imread, imresize, imsave, fromimage, toimage
from scipy.optimize import fmin_l_bfgs_b
import numpy as np
import time
import argparse
import warnings
from keras.models import Model
from k... | true | true |
f714646378a1286e368211c93a3126a60f12ee58 | 3,625 | py | Python | src/varDA.py | aerorahul/lorenz-da | d8a01f512c974f4d74f8ea06d016956ff165da4b | [
"Apache-2.0"
] | 8 | 2017-09-02T07:50:14.000Z | 2022-03-17T06:48:32.000Z | src/varDA.py | aerorahul/lorenz-da | d8a01f512c974f4d74f8ea06d016956ff165da4b | [
"Apache-2.0"
] | 1 | 2020-01-03T04:46:07.000Z | 2020-02-14T18:29:28.000Z | src/varDA.py | aerorahul/lorenz-da | d8a01f512c974f4d74f8ea06d016956ff165da4b | [
"Apache-2.0"
] | 8 | 2017-08-30T03:31:27.000Z | 2021-03-18T16:03:50.000Z | #!/usr/bin/env python
###############################################################
# < next few lines under version control, D O N O T E D I T >
# $Date$
# $Revision$
# $Author$
# $Id$
###############################################################
###############################################################
... | 35.539216 | 128 | 0.486069 |
__author__ = "Rahul Mahajan"
__email__ = "rahul.mahajan@nasa.gov"
__copyright__ = "Copyright 2012, NASA / GSFC / GMAO"
__license__ = "GPL"
__status__ = "Prototype"
import sys
import numpy as np
from module_Lorenz import *
from module_DA import *
from module_IO import *
from p... | false | true |
f7146499f43a1ececce716dc775d27d50a4ee29c | 846 | py | Python | test/test_item_option.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_item_option.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_item_option.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
f... | 18.8 | 79 | 0.680851 |
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
from ultracart.rest import ApiException
from ultracart.models.item_option import ItemOption
class TestItemOption(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testI... | true | true |
f71466828b23b73c75d19b330e7be8b61bb3a893 | 432 | py | Python | python-startup.py | stinbetz/installify | 850dfd80300f594cd0366df5201a7915229990b1 | [
"MIT"
] | null | null | null | python-startup.py | stinbetz/installify | 850dfd80300f594cd0366df5201a7915229990b1 | [
"MIT"
] | null | null | null | python-startup.py | stinbetz/installify | 850dfd80300f594cd0366df5201a7915229990b1 | [
"MIT"
] | null | null | null | import sys
import subprocess
def snipe_import_exceptions(exctype, value, traceback):
if exctype == ImportError:
module = str(value).split(" ")[-1:][0]
install_module(module)
else:
sys.__excepthook__(exctype, value, traceback)
sys.excepthook = snipe_import_exceptions
def install_module... | 25.411765 | 62 | 0.706019 | import sys
import subprocess
def snipe_import_exceptions(exctype, value, traceback):
if exctype == ImportError:
module = str(value).split(" ")[-1:][0]
install_module(module)
else:
sys.__excepthook__(exctype, value, traceback)
sys.excepthook = snipe_import_exceptions
def install_module... | false | true |
f714679fa4b4036479edd5366153bd136b63a604 | 8,720 | py | Python | pta_sim/pint_sim.py | Hazboun6/pta_sim | cf8676e23056586ecb35a030dbaad45a1f985764 | [
"MIT"
] | 1 | 2019-05-22T10:35:49.000Z | 2019-05-22T10:35:49.000Z | pta_sim/pint_sim.py | Hazboun6/pta_sim | cf8676e23056586ecb35a030dbaad45a1f985764 | [
"MIT"
] | 1 | 2021-11-15T17:48:32.000Z | 2021-11-15T17:48:32.000Z | pta_sim/pint_sim.py | Hazboun6/pta_sim | cf8676e23056586ecb35a030dbaad45a1f985764 | [
"MIT"
] | 2 | 2019-05-23T13:55:53.000Z | 2021-06-23T13:15:22.000Z | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import astropy.units as u
from astropy.time import Time, TimeDelta
from pint.residuals import resids
import pint.toa as toa
from pint import models
__all__ = ['make_ideal',
'createfourierdesignmatrix_red',
'add_rednoise',
'add_d... | 31.142857 | 84 | 0.592431 | import numpy as np
import astropy.units as u
from astropy.time import Time, TimeDelta
from pint.residuals import resids
import pint.toa as toa
from pint import models
__all__ = ['make_ideal',
'createfourierdesignmatrix_red',
'add_rednoise',
'add_dm_rednoise',
'add_efac',
... | true | true |
f71467a510667cf3558e0f2dd126bccf19a330a0 | 8,753 | py | Python | data/external/repositories_2to3/137656/blundercheck-master/combine/data_prep/prepare_pgmodel.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/data_prep/prepare_pgmodel.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/137656/blundercheck-master/combine/data_prep/prepare_pgmodel.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | #!/usr/bin/env python
from pandas import *
from numpy import *
from djeval import *
import csv, code
import pickle as pickle
from sklearn.externals import joblib
NUM_GAMES=50000
def shell():
vars = globals()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact... | 35.294355 | 280 | 0.69302 |
from pandas import *
from numpy import *
from djeval import *
import csv, code
import pickle as pickle
from sklearn.externals import joblib
NUM_GAMES=50000
def shell():
vars = globals()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact()
msg("Hi! Reading ... | true | true |
f71467e65dae3f982a9af5237ac320ca8270123d | 9,283 | py | Python | src/transformers/models/mctct/configuration_mctct.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/mctct/configuration_mctct.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/mctct/configuration_mctct.py | shangz-ai/transformers | 75259b44bf2e2b98b5a4d431fb400b7190342a01 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The HuggingFace Inc. team. 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 r... | 49.908602 | 119 | 0.679845 |
from ...configuration_utils import PretrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json",
}
class MCTCTConfig(PretrainedConfig):
... | true | true |
f71468717fc5e61acbe354ad1694025b5b1bf250 | 1,649 | py | Python | .venv/lib/python3.8/site-packages/opencensus/stats/measurement.py | MarkusMeyer13/graph-teams-presence | c302b79248f31623a1b209e098afc4f85d96228d | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/opencensus/stats/measurement.py | MarkusMeyer13/graph-teams-presence | c302b79248f31623a1b209e098afc4f85d96228d | [
"MIT"
] | 1 | 2021-07-28T09:45:24.000Z | 2021-07-28T09:45:24.000Z | .venv/lib/python3.8/site-packages/opencensus/stats/measurement.py | MarkusMeyer13/graph-teams-presence | c302b79248f31623a1b209e098afc4f85d96228d | [
"MIT"
] | null | null | null | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 32.333333 | 77 | 0.681019 |
class Measurement(object):
def __init__(self, measure, value):
self._measure = measure
self._value = value
@property
def value(self):
return self._value
@property
def measure(self):
return self._measure
class MeasurementInt(Measurement):
def... | true | true |
f71468baccb7f26415744498bbf3284f96465119 | 26,158 | py | Python | tests/system/test_integration.py | jhonnysanchezillisaca/apm-server | eeae18ef1551769bd03998e6798aadc94dda0a3d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/system/test_integration.py | jhonnysanchezillisaca/apm-server | eeae18ef1551769bd03998e6798aadc94dda0a3d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/system/test_integration.py | jhonnysanchezillisaca/apm-server | eeae18ef1551769bd03998e6798aadc94dda0a3d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import os
import unittest
from apmserver import ElasticTest, ExpvarBaseTest
from apmserver import ClientSideElasticTest, SmapIndexBaseTest, SmapCacheBaseTest
from apmserver import SplitIndicesTest
from beat.beat import INTEGRATION_TESTS
import json
import time
class Test(ElasticTest):
@unittest.skipUnless(INTEG... | 45.571429 | 136 | 0.601155 | import os
import unittest
from apmserver import ElasticTest, ExpvarBaseTest
from apmserver import ClientSideElasticTest, SmapIndexBaseTest, SmapCacheBaseTest
from apmserver import SplitIndicesTest
from beat.beat import INTEGRATION_TESTS
import json
import time
class Test(ElasticTest):
@unittest.skipUnless(INTEG... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.