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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2dcb2cd8344904ed92b020972ac557bf1fb37a | 1,379 | py | Python | 03 AccessWebData/JSONdataInAPI.py | blueicy/Python-achieve | cbe7a0f898bef5f1d951d69cef0c305a62faaaf8 | [
"MIT"
] | null | null | null | 03 AccessWebData/JSONdataInAPI.py | blueicy/Python-achieve | cbe7a0f898bef5f1d951d69cef0c305a62faaaf8 | [
"MIT"
] | null | null | null | 03 AccessWebData/JSONdataInAPI.py | blueicy/Python-achieve | cbe7a0f898bef5f1d951d69cef0c305a62faaaf8 | [
"MIT"
] | null | null | null | import urllib.request, urllib.parse, urllib.error
import json
import ssl
api_key = False
#api_key = 'AIzaSy___IDByT70'
# https://developers.google.com/maps/documentation/geocoding/intro
if api_key is False:
api_key = 42
serviceurl = 'http://py4e-data.dr-chuck.net/json?'
else :
serviceurl = 'https://maps.... | 20.279412 | 69 | 0.684554 | import urllib.request, urllib.parse, urllib.error
import json
import ssl
api_key = False
if api_key is False:
api_key = 42
serviceurl = 'http://py4e-data.dr-chuck.net/json?'
else :
serviceurl = 'https://maps.googleapis.com/maps/api/geocode/json?'
ctx = ssl.create_default_context()
ctx.check_hostname ... | true | true |
1c2dccd0e95cc8419c1e9dad4a3fa248bfb5459c | 441 | py | Python | Get_pid.py | tokyohost/Download-Thz-Torrent | 4f90cf710aaa143cab2e07e7348c625d34f9ad7c | [
"MIT"
] | 4 | 2019-11-28T05:56:36.000Z | 2021-12-25T01:48:21.000Z | Get_pid.py | tokyohost/get-Thz-Torrent-and-info | 4f90cf710aaa143cab2e07e7348c625d34f9ad7c | [
"MIT"
] | null | null | null | Get_pid.py | tokyohost/get-Thz-Torrent-and-info | 4f90cf710aaa143cab2e07e7348c625d34f9ad7c | [
"MIT"
] | 2 | 2020-02-10T15:23:59.000Z | 2020-02-29T13:11:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
def Get_pid(soup):
#返回当前页面的唯一pid
pid = soup.findAll('div', {'class': "pls"}) #匹配到指定容器
Get_pid = str(pid) # 转换成文本文档
p = re.compile(r'\d+') # 匹配数字也就是每个页面单独的 Pid
pidnumber = p.findall(Get_pid)
# print(pidnumber)
# print("页面唯一pid为:"+pidnumber... | 31.5 | 85 | 0.637188 |
import re
def Get_pid(soup):
pid = soup.findAll('div', {'class': "pls"})
Get_pid = str(pid)
p = re.compile(r'\d+')
pidnumber = p.findall(Get_pid)
| true | true |
1c2dcdc18755de16380093bc5feef68ea0db1a64 | 9,695 | py | Python | tests/test_buffer_io.py | Infinidat/infi.instruct | 69dfd8a35d17f8687581e838ea13e7554f7e5034 | [
"BSD-3-Clause"
] | 2 | 2015-01-12T21:16:06.000Z | 2019-12-12T05:59:56.000Z | tests/test_buffer_io.py | Infinidat/infi.instruct | 69dfd8a35d17f8687581e838ea13e7554f7e5034 | [
"BSD-3-Clause"
] | 4 | 2015-02-24T09:18:00.000Z | 2021-06-16T12:55:19.000Z | tests/test_buffer_io.py | Infinidat/infi.instruct | 69dfd8a35d17f8687581e838ea13e7554f7e5034 | [
"BSD-3-Clause"
] | 4 | 2015-01-07T12:37:54.000Z | 2018-02-08T15:07:17.000Z | import random
from bitarray import bitarray
from infi.instruct._compat import range, PY2
from infi.unittest import TestCase
from infi.instruct.buffer.io_buffer import BitView, BitAwareByteArray
random.seed(0)
class IOBufferTestCase(TestCase):
def test_getitem__byte(self):
buf = BitAwareByteArray(bytearra... | 38.78 | 114 | 0.588345 | import random
from bitarray import bitarray
from infi.instruct._compat import range, PY2
from infi.unittest import TestCase
from infi.instruct.buffer.io_buffer import BitView, BitAwareByteArray
random.seed(0)
class IOBufferTestCase(TestCase):
def test_getitem__byte(self):
buf = BitAwareByteArray(bytearra... | true | true |
1c2dce5bfdbcf0694685a6a9b512196a77735640 | 59 | py | Python | hackerrank/contest/30-days-of-code/day-0.py | everyevery/programming_study | ff35e97e13953e4d7a26591f7cdb301d3e8e36c6 | [
"MIT"
] | null | null | null | hackerrank/contest/30-days-of-code/day-0.py | everyevery/programming_study | ff35e97e13953e4d7a26591f7cdb301d3e8e36c6 | [
"MIT"
] | null | null | null | hackerrank/contest/30-days-of-code/day-0.py | everyevery/programming_study | ff35e97e13953e4d7a26591f7cdb301d3e8e36c6 | [
"MIT"
] | 1 | 2017-04-01T21:34:23.000Z | 2017-04-01T21:34:23.000Z | print("Hello World.")
print("Welcome to 30 Days of Code.")
| 19.666667 | 36 | 0.694915 | print("Hello World.")
print("Welcome to 30 Days of Code.")
| true | true |
1c2dcedc16a975d99b38345494a90675175ec9d4 | 3,244 | py | Python | scripts/te_totals_frac_AF.py | klaricch/Transposons2 | a0f216e7a3ad8c462706237953325ad0b13a5646 | [
"MIT"
] | 1 | 2018-04-17T16:48:04.000Z | 2018-04-17T16:48:04.000Z | scripts/te_totals_frac_AF.py | klaricch/Transposons2 | a0f216e7a3ad8c462706237953325ad0b13a5646 | [
"MIT"
] | null | null | null | scripts/te_totals_frac_AF.py | klaricch/Transposons2 | a0f216e7a3ad8c462706237953325ad0b13a5646 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import re
from collections import defaultdict
infile=sys.argv[1]
indexed_fam={}
all_families={}
OUT=open("kin_frac_matrix_AF.txt", 'w')
OUTC=open("kin_C_matrix_AF.txt", 'w')
with open(infile, 'r') as IN:
headers=next(IN)
headers=headers.rstrip('\n')
headers=re.split("[\t]",heade... | 23.852941 | 62 | 0.639026 |
import sys
import re
from collections import defaultdict
infile=sys.argv[1]
indexed_fam={}
all_families={}
OUT=open("kin_frac_matrix_AF.txt", 'w')
OUTC=open("kin_C_matrix_AF.txt", 'w')
with open(infile, 'r') as IN:
headers=next(IN)
headers=headers.rstrip('\n')
headers=re.split("[\t]",headers)
for ID,i in enu... | false | true |
1c2dcf6bc1e94dd061c0dcbff3ca0362a7c8ab4f | 48,202 | bzl | Python | examples/checked_in_requirements_bzl/requirements.bzl | therc/rules_python | d2716fb59f8e60ccc2af347859ad162a067e6d13 | [
"Apache-2.0"
] | 1 | 2019-02-11T04:46:51.000Z | 2019-02-11T04:46:51.000Z | examples/checked_in_requirements_bzl/requirements.bzl | therc/rules_python | d2716fb59f8e60ccc2af347859ad162a067e6d13 | [
"Apache-2.0"
] | 2 | 2018-02-22T11:09:50.000Z | 2018-04-20T05:28:20.000Z | examples/checked_in_requirements_bzl/requirements.bzl | mirandaconrado/rules_python | 670a7b7357024fb4803022a66c977931f12bac6c | [
"Apache-2.0"
] | null | null | null | # Install pip requirements.
#
# Generated from /home/lpeltonen/go/src/github.com/bazelbuild/rules_python/examples/checked_in_requirements_bzl/requirements.txt
# Generated from /home/lpeltonen/go/src/github.com/bazelbuild/rules_python/examples/checked_in_requirements_bzl/requirements-2.txt
load("@examples_checked_in_re... | 68.081921 | 1,136 | 0.72775 |
load("@examples_checked_in_requirements_bzl//python:whl.bzl", "whl_library")
_requirements = {
"atomicwrites": "@examples_checked_in_requirements_bzl__atomicwrites_1_2_1//:pkg",
"atomicwrites:dirty": "@examples_checked_in_requirements_bzl__atomicwrites_1_2_1_dirty//:pkg",
"attrs": "@examples_checked_in_requ... | true | true |
1c2dcf8e3706cc01b274591fa63e3b945e1e564e | 7,149 | py | Python | pyro/distributions/empirical.py | adam-coogan/pyro | 6395b0f5f0b4744d3c822a39526027fb3fdb8b04 | [
"MIT"
] | null | null | null | pyro/distributions/empirical.py | adam-coogan/pyro | 6395b0f5f0b4744d3c822a39526027fb3fdb8b04 | [
"MIT"
] | null | null | null | pyro/distributions/empirical.py | adam-coogan/pyro | 6395b0f5f0b4744d3c822a39526027fb3fdb8b04 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import math
import numbers
import torch
from torch.distributions import constraints
from pyro.distributions.torch import Categorical
from pyro.distributions.torch_distribution import TorchDistribution
from pyro.distributions.util import copy_docs_from,... | 40.619318 | 102 | 0.638131 | from __future__ import absolute_import, division, print_function
import math
import numbers
import torch
from torch.distributions import constraints
from pyro.distributions.torch import Categorical
from pyro.distributions.torch_distribution import TorchDistribution
from pyro.distributions.util import copy_docs_from,... | true | true |
1c2dcfe0288e9e98dc8564dd67eee1a75307cf99 | 165 | py | Python | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | 41.25 | 87 | 0.757576 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | true | true |
1c2dcfeff930260114a1a4a118ef0bf1cb482eaf | 16,703 | py | Python | openstack_dashboard/usage/quotas.py | ilay09/horizon | a362e4b767f7616d344545aa0f9205857d3900a4 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/usage/quotas.py | ilay09/horizon | a362e4b767f7616d344545aa0f9205857d3900a4 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/usage/quotas.py | ilay09/horizon | a362e4b767f7616d344545aa0f9205857d3900a4 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 36.469432 | 79 | 0.64695 |
from collections import defaultdict
import itertools
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon.utils.memoized import memoized
from openstack_dashboard.api import base
from openstack_dashboard.api import cinder
from openstack_dashboa... | true | true |
1c2dd03ed4752a62c2b24818fa3674ec47b4f620 | 11,122 | py | Python | wagtail/wagtailimages/tests/test_image_operations.py | isabella232/wagtail | 52bc8ae62719d3b955f1016efc9c691d4ac584e1 | [
"BSD-3-Clause"
] | 1 | 2021-09-21T00:06:52.000Z | 2021-09-21T00:06:52.000Z | wagtail/wagtailimages/tests/test_image_operations.py | revsys/wagtail | 52bc8ae62719d3b955f1016efc9c691d4ac584e1 | [
"BSD-3-Clause"
] | 1 | 2021-02-24T08:25:30.000Z | 2021-02-24T08:25:30.000Z | wagtail/wagtailimages/tests/test_image_operations.py | isabella232/wagtail | 52bc8ae62719d3b955f1016efc9c691d4ac584e1 | [
"BSD-3-Clause"
] | 1 | 2020-11-24T10:21:24.000Z | 2020-11-24T10:21:24.000Z | import unittest
from wagtail.wagtailimages import image_operations
from wagtail.wagtailimages.exceptions import InvalidFilterSpecError
from wagtail.wagtailimages.models import Image, Filter
class WillowOperationRecorder(object):
"""
This class pretends to be a Willow image but instead, it records
the ope... | 31.241573 | 100 | 0.577864 | import unittest
from wagtail.wagtailimages import image_operations
from wagtail.wagtailimages.exceptions import InvalidFilterSpecError
from wagtail.wagtailimages.models import Image, Filter
class WillowOperationRecorder(object):
def __init__(self, start_size):
self.ran_operations = []
self.start_... | true | true |
1c2dd1c1e204abef3b610274e85d4878859d378e | 77,002 | py | Python | Lib/unittest/mock.py | adamwen829/cpython | 0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667 | [
"PSF-2.0"
] | 2 | 2017-05-05T02:07:59.000Z | 2017-08-18T09:24:48.000Z | Lib/unittest/mock.py | adamwen829/cpython | 0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667 | [
"PSF-2.0"
] | null | null | null | Lib/unittest/mock.py | adamwen829/cpython | 0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667 | [
"PSF-2.0"
] | 3 | 2016-04-21T07:58:27.000Z | 2016-05-06T21:34:44.000Z | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | 32.683362 | 85 | 0.609504 |
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
'NonCallableMock',
'NonCallableMagicMock',
'mock_open',
'PropertyMock',
)
__version__ = '1.0'
import inspect
import pprint
import sys
import buil... | true | true |
1c2dd28147cce5307dcfac0fa27383f178868eeb | 2,046 | py | Python | paddlespeech/server/restful/api.py | qingen/PaddleSpeech | 657c424f6c679873118c4e94bc24a3ff00b58ae1 | [
"Apache-2.0"
] | null | null | null | paddlespeech/server/restful/api.py | qingen/PaddleSpeech | 657c424f6c679873118c4e94bc24a3ff00b58ae1 | [
"Apache-2.0"
] | null | null | null | paddlespeech/server/restful/api.py | qingen/PaddleSpeech | 657c424f6c679873118c4e94bc24a3ff00b58ae1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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 appli... | 35.894737 | 74 | 0.706745 |
import sys
from typing import List
from fastapi import APIRouter
from paddlespeech.cli.log import logger
from paddlespeech.server.restful.asr_api import router as asr_router
from paddlespeech.server.restful.cls_api import router as cls_router
from paddlespeech.server.restful.text_api import router as tex... | true | true |
1c2dd2b635c7b8fbba9234c5737e118e5d548eff | 182 | py | Python | main.py | Iampato/Smart-Meter | 9531c860ca48a452212f5122a3c5d84965e4ce42 | [
"MIT"
] | 2 | 2020-11-20T12:29:42.000Z | 2020-11-24T07:28:32.000Z | main.py | Iampato/Smart-Meter | 9531c860ca48a452212f5122a3c5d84965e4ce42 | [
"MIT"
] | 1 | 2021-02-01T07:12:57.000Z | 2021-02-01T07:12:57.000Z | main.py | Iampato/Smart-Meter | 9531c860ca48a452212f5122a3c5d84965e4ce42 | [
"MIT"
] | null | null | null | from config.connect import SmartMeterConfig
def main():
smartMeterConfig = SmartMeterConfig()
print(smartMeterConfig.database_user)
if __name__ == "__main__":
main()
| 16.545455 | 43 | 0.736264 | from config.connect import SmartMeterConfig
def main():
smartMeterConfig = SmartMeterConfig()
print(smartMeterConfig.database_user)
if __name__ == "__main__":
main()
| true | true |
1c2dd3309b544c4e3f22b3bb0f618dee13a80a3c | 54 | py | Python | codingbat.com/Warmup-1/missing_char.py | ahmedelq/PythonicAlgorithms | ce10dbb6e1fd0ea5c922a932b0f920236aa411bf | [
"MIT"
] | null | null | null | codingbat.com/Warmup-1/missing_char.py | ahmedelq/PythonicAlgorithms | ce10dbb6e1fd0ea5c922a932b0f920236aa411bf | [
"MIT"
] | null | null | null | codingbat.com/Warmup-1/missing_char.py | ahmedelq/PythonicAlgorithms | ce10dbb6e1fd0ea5c922a932b0f920236aa411bf | [
"MIT"
] | null | null | null | def missing_char(str, n):
return str[:n] + str[n+1:] | 27 | 28 | 0.62963 | def missing_char(str, n):
return str[:n] + str[n+1:] | true | true |
1c2dd48d13f791fc40091655352263415312c629 | 6,845 | py | Python | sim_results/results/read_results.py | maxrudolph1/robotarium_mpe | 025c182899c0092c95e1ed3c2a38117f257cbe25 | [
"MIT"
] | null | null | null | sim_results/results/read_results.py | maxrudolph1/robotarium_mpe | 025c182899c0092c95e1ed3c2a38117f257cbe25 | [
"MIT"
] | null | null | null | sim_results/results/read_results.py | maxrudolph1/robotarium_mpe | 025c182899c0092c95e1ed3c2a38117f257cbe25 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sb
import matplotlib.patches as mpatches
from scipy.stats import mannwhitneyu
sb.set_theme(style="darkgrid")
bcfc_rew = []
unif_rew = []
mono_rew = []
rand_rew = []
tasks = ['navigation','coverage','transport']
meths = ['exp... | 32.595238 | 120 | 0.57195 | import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sb
import matplotlib.patches as mpatches
from scipy.stats import mannwhitneyu
sb.set_theme(style="darkgrid")
bcfc_rew = []
unif_rew = []
mono_rew = []
rand_rew = []
tasks = ['navigation','coverage','transport']
meths = ['exp... | true | true |
1c2dd54f4917d6742cc724519b3825c068474f33 | 368 | py | Python | pages/tests.py | waseidel/django | 59b32cf9d0a9104976038015bcaea1243a8e48f9 | [
"MIT"
] | null | null | null | pages/tests.py | waseidel/django | 59b32cf9d0a9104976038015bcaea1243a8e48f9 | [
"MIT"
] | null | null | null | pages/tests.py | waseidel/django | 59b32cf9d0a9104976038015bcaea1243a8e48f9 | [
"MIT"
] | null | null | null | # pages/tests.py
from django.test import SimpleTestCase
class PagesTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_about_page_status_code(self):
response = self.client.get('/about/')
... | 28.307692 | 51 | 0.714674 |
from django.test import SimpleTestCase
class PagesTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_about_page_status_code(self):
response = self.client.get('/about/')
self.assertE... | true | true |
1c2dd7bd6529ffac6d7aa07152e39823165fea30 | 52,799 | py | Python | openprocurement/auctions/rubble/tests/blanks/migration_blanks.py | openprocurement/openprocurement.auctions.rubble | 72369d411085fe50030f99320928636307b18426 | [
"Apache-2.0"
] | 1 | 2020-09-29T08:34:32.000Z | 2020-09-29T08:34:32.000Z | openprocurement/auctions/rubble/tests/blanks/migration_blanks.py | openprocurement/openprocurement.auctions.rubble | 72369d411085fe50030f99320928636307b18426 | [
"Apache-2.0"
] | 21 | 2018-06-06T12:45:49.000Z | 2022-03-21T22:16:26.000Z | openprocurement/auctions/rubble/tests/blanks/migration_blanks.py | openprocurement/openprocurement.auctions.rubble | 72369d411085fe50030f99320928636307b18426 | [
"Apache-2.0"
] | 8 | 2018-05-02T07:54:09.000Z | 2019-03-06T14:31:12.000Z | # -*- coding: utf-8 -*-
from copy import deepcopy
from datetime import timedelta
from uuid import uuid4
from openprocurement.auctions.core.utils import get_now
# MigrateTestFrom1To2Bids
def migrate_one_pending(self):
auction = self.db.get(self.auction_id)
award = {
'id': uuid4().hex,
"date": ... | 42.511272 | 170 | 0.645561 |
from copy import deepcopy
from datetime import timedelta
from uuid import uuid4
from openprocurement.auctions.core.utils import get_now
def migrate_one_pending(self):
auction = self.db.get(self.auction_id)
award = {
'id': uuid4().hex,
"date": get_now().isoformat(),
"bid_id": auction... | true | true |
1c2ddab2802f47e91f90b0674c0c5a4a19053d32 | 44,165 | py | Python | mimic_direct_extract.py | joefarrington/MIMIC_Extract | e07ea560f869670af5be75823f020b557a5429f0 | [
"MIT"
] | null | null | null | mimic_direct_extract.py | joefarrington/MIMIC_Extract | e07ea560f869670af5be75823f020b557a5429f0 | [
"MIT"
] | null | null | null | mimic_direct_extract.py | joefarrington/MIMIC_Extract | e07ea560f869670af5be75823f020b557a5429f0 | [
"MIT"
] | null | null | null | # MIMIC IIIv14 on postgres 9.4
import numpy as np
import pandas as pd
from pandas import DataFrame
import psycopg2
from sklearn import metrics
from datetime import datetime
from datetime import timedelta
import sys
import os
import time
from os import environ
from os.path import isfile, isdir, splitext
import argparse... | 42.920311 | 153 | 0.643202 |
import numpy as np
import pandas as pd
from pandas import DataFrame
import psycopg2
from sklearn import metrics
from datetime import datetime
from datetime import timedelta
import sys
import os
import time
from os import environ
from os.path import isfile, isdir, splitext
import argparse
import cPickle
import numpy a... | false | true |
1c2ddb1aa5471a29b28d3e92c036bb3198402c5f | 186 | py | Python | tests/test_loggers.py | DuinoDu/pl-extension | 1ed8f3dd95aa569ee3493fcc69634d3ab9322430 | [
"Apache-2.0"
] | null | null | null | tests/test_loggers.py | DuinoDu/pl-extension | 1ed8f3dd95aa569ee3493fcc69634d3ab9322430 | [
"Apache-2.0"
] | null | null | null | tests/test_loggers.py | DuinoDu/pl-extension | 1ed8f3dd95aa569ee3493fcc69634d3ab9322430 | [
"Apache-2.0"
] | null | null | null | from pl_extension.loggers import logging_logger
def test_logginglogger(tmpdir):
logger = logging_logger.LoggingLogger(tmpdir, prefix="ple")
logger.info("hello, pl-extension!")
| 26.571429 | 63 | 0.774194 | from pl_extension.loggers import logging_logger
def test_logginglogger(tmpdir):
logger = logging_logger.LoggingLogger(tmpdir, prefix="ple")
logger.info("hello, pl-extension!")
| true | true |
1c2ddbf80da42ca685b9a2e8003bcc2cac058518 | 1,630 | py | Python | lagou/lagou/pipelines.py | githubsuzhou/ScrapyLagou | 1e505d584792046d47aea47d5b475fe3581cb51a | [
"Apache-2.0"
] | null | null | null | lagou/lagou/pipelines.py | githubsuzhou/ScrapyLagou | 1e505d584792046d47aea47d5b475fe3581cb51a | [
"Apache-2.0"
] | null | null | null | lagou/lagou/pipelines.py | githubsuzhou/ScrapyLagou | 1e505d584792046d47aea47d5b475fe3581cb51a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql,json
from scrapy.conf import settings
class LagouPipeline(object):
def process_item(self, item, spider):
... | 46.571429 | 184 | 0.607362 |
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql,json
from scrapy.conf import settings
class LagouPipeline(object):
def process_item(self, item, spider):
char=settings['CHARSET']
host = settings['MYSQL_HOST']
psd = settings['MYSQL_PASSWD']
db = ... | true | true |
1c2ddc8f9a5d1ee3adbdbd7d0706246544cde6b7 | 5,748 | py | Python | cloudbutton_geospatial/datafetch_utils/sentinel.py | berkevaroll/geospatial-usecase | d3db18607be0976badde073b3ee7c8b9613372e1 | [
"Apache-2.0"
] | null | null | null | cloudbutton_geospatial/datafetch_utils/sentinel.py | berkevaroll/geospatial-usecase | d3db18607be0976badde073b3ee7c8b9613372e1 | [
"Apache-2.0"
] | null | null | null | cloudbutton_geospatial/datafetch_utils/sentinel.py | berkevaroll/geospatial-usecase | d3db18607be0976badde073b3ee7c8b9613372e1 | [
"Apache-2.0"
] | 4 | 2021-03-29T09:03:52.000Z | 2021-09-21T18:27:01.000Z | """
Este módulo contiene métodos de utilidad para la descarga de
imágenes del satélite Sentinel-2.
Los distintos tiles del sistema de coordenadas MGRS en que
se divide España se pueden encontrar
en esta web https://www.asturnatura.com/sinflac/utm-mgrs.php
La documentación de la librería sentinelsat se puede consultar... | 40.765957 | 124 | 0.705811 |
import collections
import os
import os.path
import zipfile
import sentinelsat
SENT_USER = 'vmoreno'
SENT_PASS = '12345678'
BANDS_DIR = 'bands'
ZIP_EXTENSION = ".zip"
GRANULE_DIR = 'GRANULE'
IMAGE_DATA_DIR = 'IMG_DATA'
SAFE_EXTENSION = '.SAFE'
JP2_EXTENSION = '.jp2'
def download_products(tiles, start_date, end_da... | true | true |
1c2ddde4c9264ef06c744be59061bedaa0f73663 | 926 | py | Python | 1.7.video_stream.py | enesonmez/opencv-learning | 3cbefc16a8793b5f1c24cc9080c005b4f58714cd | [
"MIT"
] | null | null | null | 1.7.video_stream.py | enesonmez/opencv-learning | 3cbefc16a8793b5f1c24cc9080c005b4f58714cd | [
"MIT"
] | null | null | null | 1.7.video_stream.py | enesonmez/opencv-learning | 3cbefc16a8793b5f1c24cc9080c005b4f58714cd | [
"MIT"
] | null | null | null | import cv2
cap = cv2.VideoCapture(0) # 0 => pc kamerası, 1 => usb'ye bağlı kamera, 2 =>
# video'yu kaydetmek için
fourcc = cv2.VideoWriter_fourcc(*'XVID') # 4 byte'lık video codec kodu alarak int veri döndürür.
out = cv2.VideoWriter('img/output.avi', fourcc, 20.0, (640,480)) # video adı, codec code, fps, video size
... | 40.26087 | 112 | 0.719222 | import cv2
cap = cv2.VideoCapture(0)
# video'yu kaydetmek için
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('img/output.avi', fourcc, 20.0, (640,480)) # video adı, codec code, fps, video size
while True:
ret, frame = cap.read() # kameradan o anki görüntü okunuyor. ret => kamera çalışıp çalışm... | true | true |
1c2dde7de9058c62d67b5be58652d6aa606b8599 | 1,509 | py | Python | recursion-cellular/utils/logger.py | rebryk/kaggle | 0c656f64ce681dd313ca5145f0ff834a1a6d822e | [
"MIT"
] | 17 | 2019-01-11T01:57:29.000Z | 2020-08-25T04:52:28.000Z | recursion-cellular/utils/logger.py | rebryk/kaggle | 0c656f64ce681dd313ca5145f0ff834a1a6d822e | [
"MIT"
] | 10 | 2020-01-28T23:01:43.000Z | 2022-03-11T23:37:54.000Z | recursion-cellular/utils/logger.py | rebryk/kaggle | 0c656f64ce681dd313ca5145f0ff834a1a6d822e | [
"MIT"
] | 3 | 2019-01-11T03:12:04.000Z | 2019-01-28T14:41:14.000Z | import logging
import sys
from pathlib import Path
from typing import Union, Any
from torch.utils.tensorboard import SummaryWriter
class Logger(logging.Logger):
"""This class allows you to log information to the console, file and tensorboardX."""
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(mess... | 32.106383 | 89 | 0.603711 | import logging
import sys
from pathlib import Path
from typing import Union, Any
from torch.utils.tensorboard import SummaryWriter
class Logger(logging.Logger):
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
DATE_FORMAT = '%m/%d/%Y %I:%M:%S %p'
def __init__(self,
n... | true | true |
1c2de051eef67fd3e5e73674a713b6ba775d6631 | 4,282 | py | Python | src/mbf_anysnake/util.py | IMTMarburg/mbf_anysnake | fab457a8058f74e5729fd6317393d126e0329f31 | [
"MIT"
] | null | null | null | src/mbf_anysnake/util.py | IMTMarburg/mbf_anysnake | fab457a8058f74e5729fd6317393d126e0329f31 | [
"MIT"
] | null | null | null | src/mbf_anysnake/util.py | IMTMarburg/mbf_anysnake | fab457a8058f74e5729fd6317393d126e0329f31 | [
"MIT"
] | 1 | 2021-04-15T06:44:15.000Z | 2021-04-15T06:44:15.000Z | # -*- coding: future_fstrings -*-
import re
import requests
import subprocess
import time
import shutil
import time
from pathlib import Path
re_github = r"[A-Za-z0-9-]+\/[A-Za-z0-9]+"
def combine_volumes(ro=[], rw=[]):
d = dict()
for (what, mode) in [(ro, "ro"), (rw, "rw")]:
if isinstance(what, dict)... | 30.368794 | 88 | 0.556049 |
import re
import requests
import subprocess
import time
import shutil
import time
from pathlib import Path
re_github = r"[A-Za-z0-9-]+\/[A-Za-z0-9]+"
def combine_volumes(ro=[], rw=[]):
d = dict()
for (what, mode) in [(ro, "ro"), (rw, "rw")]:
if isinstance(what, dict):
what = [what]
... | true | true |
1c2de0769c358be38996bcb87d548b7c10da2a40 | 70 | py | Python | test/test_cases/google_noqa.py | PFacheris/flake8-function-definition | 74e7ee29dd3bccb08e5636603e60aaa4b7e505af | [
"MIT"
] | null | null | null | test/test_cases/google_noqa.py | PFacheris/flake8-function-definition | 74e7ee29dd3bccb08e5636603e60aaa4b7e505af | [
"MIT"
] | 1 | 2016-09-19T14:01:13.000Z | 2016-09-20T00:36:41.000Z | test/test_cases/google_noqa.py | PFacheris/flake8-function-definition | 74e7ee29dd3bccb08e5636603e60aaa4b7e505af | [
"MIT"
] | null | null | null | def foo( # noqa
bar1, bar2, bar3,
bar4
): # noqa
return
| 11.666667 | 21 | 0.514286 | def foo(
bar1, bar2, bar3,
bar4
):
return
| true | true |
1c2de0ca36c4668ac520ad4379744e1b65453ae1 | 3,521 | py | Python | app/wallet/permissions.py | HenriqueLR/payments | f2f7316fe12b683705e9a78813a86e43c08a2cf6 | [
"MIT"
] | null | null | null | app/wallet/permissions.py | HenriqueLR/payments | f2f7316fe12b683705e9a78813a86e43c08a2cf6 | [
"MIT"
] | 9 | 2017-06-01T12:28:25.000Z | 2017-10-26T11:21:37.000Z | app/wallet/permissions.py | HenriqueLR/payments | f2f7316fe12b683705e9a78813a86e43c08a2cf6 | [
"MIT"
] | null | null | null | #encoding: utf-8
from django.db.models import Q
from django.contrib.auth.decorators import login_required, user_passes_test
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
from django.http import Http404
from main.utils import apps_permissions, format_date
... | 36.298969 | 91 | 0.664016 |
from django.db.models import Q
from django.contrib.auth.decorators import login_required, user_passes_test
from django.views.decorators.cache import never_cache
from django.utils.decorators import method_decorator
from django.http import Http404
from main.utils import apps_permissions, format_date
class Permission... | true | true |
1c2de10847f0ffbd5d32cfa1851e433c0275227d | 1,654 | py | Python | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | catalyst/utils/__init__.py | olgaiv39/catalyst | 005a123482b0340c599a58856f396355a76a7db5 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from .argparse import args_are_not_none, boolean_flag
from .checkpoint import pack_checkpoint, unpack_checkpoint, \
save_checkpoint, load_checkpoint
from .compression import pack, pack_if_needed, unpack, unpack_if_needed
from .config import load_ordered_yaml, get_environment_vars, dump_environment, ... | 47.257143 | 80 | 0.819831 |
from .argparse import args_are_not_none, boolean_flag
from .checkpoint import pack_checkpoint, unpack_checkpoint, \
save_checkpoint, load_checkpoint
from .compression import pack, pack_if_needed, unpack, unpack_if_needed
from .config import load_ordered_yaml, get_environment_vars, dump_environment, \
parse_co... | true | true |
1c2de16d36015f768686e1bdd57367d8a669bf1e | 956 | py | Python | setup.py | p-w/block-parser | 180866de25f8133b412b15a022bd2dcad2ddef00 | [
"Apache-2.0"
] | 77 | 2016-02-23T04:42:53.000Z | 2022-03-17T20:29:49.000Z | setup.py | p-w/block-parser | 180866de25f8133b412b15a022bd2dcad2ddef00 | [
"Apache-2.0"
] | 6 | 2016-03-02T08:31:38.000Z | 2020-02-28T13:06:53.000Z | setup.py | p-w/block-parser | 180866de25f8133b412b15a022bd2dcad2ddef00 | [
"Apache-2.0"
] | 13 | 2016-02-24T11:32:04.000Z | 2021-08-11T09:39:12.000Z | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='block-parser',
version='1.0.0',
description='A tool for parsing ... | 31.866667 | 84 | 0.677824 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='block-parser',
version='1.0.0',
description='A tool for parsing ... | true | true |
1c2de1ba4743e8b4b37bf5153ada3c6e67fdb3b9 | 688 | py | Python | setup.py | vertiond/verthash-pospace | 442c51b877f2c99327f6a2f8a946a210cb09f789 | [
"MIT"
] | 1 | 2021-05-23T23:55:43.000Z | 2021-05-23T23:55:43.000Z | setup.py | vertiond/verthash-pospace | 442c51b877f2c99327f6a2f8a946a210cb09f789 | [
"MIT"
] | null | null | null | setup.py | vertiond/verthash-pospace | 442c51b877f2c99327f6a2f8a946a210cb09f789 | [
"MIT"
] | 8 | 2020-09-05T02:48:13.000Z | 2022-03-26T22:56:57.000Z | from setuptools import setup, Extension
verthashsources = [
'h2.c',
'tiny_sha3/sha3.c'
]
verthashincludes = [
'.',
'./tiny_sha3'
]
verthash_module = Extension('verthash',
sources=verthashsources+['verthashmodule.c'],
extra_compile_args=['-std=c99'],
... | 27.52 | 74 | 0.603198 | from setuptools import setup, Extension
verthashsources = [
'h2.c',
'tiny_sha3/sha3.c'
]
verthashincludes = [
'.',
'./tiny_sha3'
]
verthash_module = Extension('verthash',
sources=verthashsources+['verthashmodule.c'],
extra_compile_args=['-std=c99'],
... | true | true |
1c2de21bd4edb67adc137df05213d1b1725e17c7 | 7,265 | py | Python | slot/__init__.py | naqintosh/dl | 3615b78b5fd7a7808a49bb0b9124b41842100a2e | [
"Apache-2.0"
] | null | null | null | slot/__init__.py | naqintosh/dl | 3615b78b5fd7a7808a49bb0b9124b41842100a2e | [
"Apache-2.0"
] | null | null | null | slot/__init__.py | naqintosh/dl | 3615b78b5fd7a7808a49bb0b9124b41842100a2e | [
"Apache-2.0"
] | null | null | null | import copy
from core import Conf
from ability import Ability, ability_dict
from itertools import islice
class Slot(object):
att = 0
ele = 'none'
wt = 'none'
stype = 'slot'
onele = 0
a = None
mod = None
conf = None
def __init__(self):
if not self.mod:
self.mod =... | 26.709559 | 119 | 0.494701 | import copy
from core import Conf
from ability import Ability, ability_dict
from itertools import islice
class Slot(object):
att = 0
ele = 'none'
wt = 'none'
stype = 'slot'
onele = 0
a = None
mod = None
conf = None
def __init__(self):
if not self.mod:
self.mod =... | true | true |
1c2de30774589ca44009bc61cb6c73fe5ddc8883 | 2,464 | py | Python | src/directional_clustering/transformations/smooth.py | arpastrana/directional_clustering | 78fd39fe4ad207b2a639deddf4ba12d5580df5c6 | [
"MIT"
] | 6 | 2020-08-04T15:24:22.000Z | 2022-02-02T21:34:33.000Z | src/directional_clustering/transformations/smooth.py | arpastrana/apc524_directional_clustering | 9a53312c2ff983778253185f0f2946cd74e2bbd2 | [
"MIT"
] | 30 | 2020-11-12T17:13:30.000Z | 2020-12-15T16:45:33.000Z | src/directional_clustering/transformations/smooth.py | arpastrana/directional_clustering | 78fd39fe4ad207b2a639deddf4ba12d5580df5c6 | [
"MIT"
] | 3 | 2020-11-06T14:25:47.000Z | 2020-11-07T15:03:05.000Z | from compas.geometry import add_vectors
from compas.geometry import subtract_vectors
from compas.geometry import scale_vector
__all__ = ["smoothen_vector_field",
"adjacent_vectors",
"mean_vector",
"smoothed_vector"]
def smoothen_vector_field(vector_field, adjacency, iters, damping=0... | 25.936842 | 80 | 0.648945 | from compas.geometry import add_vectors
from compas.geometry import subtract_vectors
from compas.geometry import scale_vector
__all__ = ["smoothen_vector_field",
"adjacent_vectors",
"mean_vector",
"smoothed_vector"]
def smoothen_vector_field(vector_field, adjacency, iters, damping=0... | true | true |
1c2de324ee2d6f537bdcbce01218360cf5959274 | 8,551 | py | Python | spytest/apis/system/logging.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 132 | 2016-10-19T12:34:44.000Z | 2022-03-16T09:00:39.000Z | spytest/apis/system/logging.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 3,152 | 2016-09-21T23:05:58.000Z | 2022-03-31T23:29:08.000Z | spytest/apis/system/logging.py | shubav/sonic-mgmt | 0ff71b907a55489bb4ed7d17b1682380fd459bf2 | [
"Apache-2.0"
] | 563 | 2016-09-20T01:00:15.000Z | 2022-03-31T22:43:54.000Z | # This file contains the list of API's which performs logging / Syslog operations.
# Author : Prudvi Mangadu (prudvi.mangadu@broadcom.com)
import re
import json
from spytest import st, putils
import apis.system.connection as conf_obj
import apis.system.switch_configuration as sc_obj
import utilities.utils as utils
... | 32.637405 | 110 | 0.652672 |
# Author : Prudvi Mangadu (prudvi.mangadu@broadcom.com)
import re
import json
from spytest import st, putils
import apis.system.connection as conf_obj
import apis.system.switch_configuration as sc_obj
import utilities.utils as utils
from utilities.common import make_list
log_files = [r'/var/log/syslog', r'/var/l... | true | true |
1c2de8c8c223f883eb5c6e24df71e2795c55607e | 45,417 | py | Python | env/lib/python3.8/site-packages/pandas/tests/groupby/test_categorical.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | env/lib/python3.8/site-packages/pandas/tests/groupby/test_categorical.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | env/lib/python3.8/site-packages/pandas/tests/groupby/test_categorical.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY37
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
MultiIndex,
Series,
qcut,
)
import pandas._testing as tm
def cartesian_product_for_groupers(result, arg... | 32.934735 | 88 | 0.571592 | from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY37
import pandas as pd
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
MultiIndex,
Series,
qcut,
)
import pandas._testing as tm
def cartesian_product_for_groupers(result, arg... | true | true |
1c2dea0484ffeef999767ba4ebabb9f092c5771c | 10,585 | py | Python | desktop/core/ext-py/eventlet-0.21.0/eventlet/tpool.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | 1 | 2021-06-06T04:10:44.000Z | 2021-06-06T04:10:44.000Z | desktop/core/ext-py/eventlet-0.21.0/eventlet/tpool.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | null | null | null | desktop/core/ext-py/eventlet-0.21.0/eventlet/tpool.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | # Copyright (c) 2007-2009, Linden Research, Inc.
# Copyright (c) 2007, IBM Corp.
#
# 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 re... | 31.409496 | 83 | 0.649032 |
import atexit
import imp
import os
import sys
import traceback
import eventlet
from eventlet import event, greenio, greenthread, patcher, timeout
from eventlet.support import six
__all__ = ['execute', 'Proxy', 'killall', 'set_num_threads']
EXC_CLASSES = (Exception, timeout.Timeout)
SYS_EXCS = (Genera... | true | true |
1c2deb37c0ac62169875bd44d9a996130cb99911 | 1,205 | py | Python | torch2trt_dynamic/converters/squeeze.py | jinfagang/pilgrim_torch2trt | 27a8e6a195cbc3a83b16483ec4c0930da4aa77e6 | [
"MIT"
] | 20 | 2020-10-10T06:14:50.000Z | 2021-09-22T08:50:16.000Z | torch2trt_dynamic/converters/squeeze.py | jinfagang/pilgrim_torch2trt | 27a8e6a195cbc3a83b16483ec4c0930da4aa77e6 | [
"MIT"
] | 2 | 2020-11-02T11:45:24.000Z | 2021-02-17T15:20:04.000Z | torch2trt_dynamic/converters/squeeze.py | jinfagang/pilgrim_torch2trt | 27a8e6a195cbc3a83b16483ec4c0930da4aa77e6 | [
"MIT"
] | 4 | 2020-10-10T05:14:18.000Z | 2020-10-27T01:47:30.000Z | from torch2trt_dynamic.torch2trt_dynamic import *
from torch2trt_dynamic.module_test import add_module_test
from .identity import *
@tensorrt_converter('torch.Tensor.squeeze')
@tensorrt_converter('torch.squeeze')
def convert_squeeze(ctx):
input = ctx.method_args[0]
dim = get_arg(ctx, 'dim',... | 36.515152 | 102 | 0.663071 | from torch2trt_dynamic.torch2trt_dynamic import *
from torch2trt_dynamic.module_test import add_module_test
from .identity import *
@tensorrt_converter('torch.Tensor.squeeze')
@tensorrt_converter('torch.squeeze')
def convert_squeeze(ctx):
input = ctx.method_args[0]
dim = get_arg(ctx, 'dim',... | true | true |
1c2deb6095ef7a4cf2ee20f56169182f5e2efe48 | 35,086 | py | Python | plugins/modules/dellemc_unity_smbshare.py | fobrice/ansible-unity | ad7271cf285ee07a18abdbb06e4490c091c936cb | [
"Apache-2.0"
] | null | null | null | plugins/modules/dellemc_unity_smbshare.py | fobrice/ansible-unity | ad7271cf285ee07a18abdbb06e4490c091c936cb | [
"Apache-2.0"
] | null | null | null | plugins/modules/dellemc_unity_smbshare.py | fobrice/ansible-unity | ad7271cf285ee07a18abdbb06e4490c091c936cb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright: (c) 2020, DellEMC
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
... | 40.94049 | 103 | 0.60745 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: dellemc_unity_smbshare
version_adde... | true | true |
1c2deb96868b2115a7d83bdec3c3e111743d28b1 | 13,072 | py | Python | neutron/plugins/ml2/db.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/db.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/db.py | krissterckx/neutron | 396deed808dc9b69d4641ffe16bcbe6655bc6cd5 | [
"Apache-2.0"
] | 1 | 2020-02-29T18:29:59.000Z | 2020-02-29T18:29:59.000Z | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | 38.110787 | 79 | 0.662255 |
from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const
from neutron_lib.db import api as db_api
from neutron_lib.plugins import direct... | true | true |
1c2deba39066dfdf0e1f993d8003d0900604f9f3 | 1,011 | py | Python | tempest/services/volume/base/base_availability_zone_client.py | Hybrid-Cloud/hybrid-tempest | 319e90c6fa6e46925b495c93cd5258f088a30ec0 | [
"Apache-2.0"
] | 3 | 2016-07-15T12:27:23.000Z | 2021-04-23T04:41:10.000Z | tempest/services/volume/base/base_availability_zone_client.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | null | null | null | tempest/services/volume/base/base_availability_zone_client.py | LIS/lis-tempest | 8e6403b2d6de81c5d18ed867b4977385c8278b75 | [
"Apache-2.0"
] | 12 | 2016-07-14T18:13:05.000Z | 2017-07-08T18:45:42.000Z | # Copyright 2014 NEC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 36.107143 | 78 | 0.733927 |
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
class BaseAvailabilityZoneClient(rest_client.RestClient):
def list_availability_zones(self):
resp, body = self.get('os-availability-zone')
body = json.loads(body)
self.expected_succ... | true | true |
1c2dec8c24007e60bf500f4a92983eb7e68a347f | 262 | py | Python | charactertype.py | pawankumarsharm/Pythoncoding | f0e5f6c1d22b101e109088529640326dd5405a6a | [
"bzip2-1.0.6"
] | null | null | null | charactertype.py | pawankumarsharm/Pythoncoding | f0e5f6c1d22b101e109088529640326dd5405a6a | [
"bzip2-1.0.6"
] | null | null | null | charactertype.py | pawankumarsharm/Pythoncoding | f0e5f6c1d22b101e109088529640326dd5405a6a | [
"bzip2-1.0.6"
] | null | null | null | print('Durga786'.isalnum()) #True
print('durga786'.isalpha())#False
print('durga'.isalpha()) #True
print('durga'.islower()) #True
print('durga'.isupper()) #False
print('Durga Software Solutions'.istitle()) #True
print('Durga Software Solutions'.isspace()) #True
| 32.75 | 49 | 0.721374 | print('Durga786'.isalnum())
print('durga786'.isalpha())
print('durga'.isalpha())
print('durga'.islower())
print('durga'.isupper())
print('Durga Software Solutions'.istitle())
print('Durga Software Solutions'.isspace())
| true | true |
1c2decf1c1c20da6ef2ec52b0d97bfc386723926 | 1,374 | py | Python | face_recognition.py | Vargha-Kh/Face-Recognition | b0990be8b145e5529e138b31ba988710397fca6d | [
"CC-BY-3.0",
"MIT"
] | 2 | 2022-03-16T11:40:16.000Z | 2022-03-18T12:38:16.000Z | face_recognition.py | Vargha-Kh/Face-Recognition | b0990be8b145e5529e138b31ba988710397fca6d | [
"CC-BY-3.0",
"MIT"
] | null | null | null | face_recognition.py | Vargha-Kh/Face-Recognition | b0990be8b145e5529e138b31ba988710397fca6d | [
"CC-BY-3.0",
"MIT"
] | null | null | null | from add_face import AddingFace
from deepface import DeepFace
import sys
if __name__ == '__main__':
while True:
print(" ************ main menu ************")
print('1. Add a new face')
print('2. Recognize a face')
print('3. Exit')
database_path = '/home/vargha/Desktop/data... | 36.157895 | 103 | 0.52984 | from add_face import AddingFace
from deepface import DeepFace
import sys
if __name__ == '__main__':
while True:
print(" ************ main menu ************")
print('1. Add a new face')
print('2. Recognize a face')
print('3. Exit')
database_path = '/home/vargha/Desktop/data... | true | true |
1c2def4561651ae473540f97572120d8637b7556 | 431 | py | Python | u3dunpack/file/serialized/SerializedFileHeader.py | smalls0098/u3d-studio | b5fb9875afdebaf457ee75c3ab42e4e828a88680 | [
"MIT"
] | 1 | 2020-07-27T03:43:47.000Z | 2020-07-27T03:43:47.000Z | u3dunpack/file/serialized/SerializedFileHeader.py | smalls0098/u3d-assets-tools | b5fb9875afdebaf457ee75c3ab42e4e828a88680 | [
"MIT"
] | null | null | null | u3dunpack/file/serialized/SerializedFileHeader.py | smalls0098/u3d-assets-tools | b5fb9875afdebaf457ee75c3ab42e4e828a88680 | [
"MIT"
] | 1 | 2021-10-03T11:23:14.000Z | 2021-10-03T11:23:14.000Z | from ...streams import EndianBinaryReader
class SerializedFileHeader:
metadataSize: int
fileSize: int
version: int
dataOffset: int
endian: bytes
reserved: bytes
def __init__(self, reader: EndianBinaryReader):
self.metadataSize = reader.readUInt()
self.fileSi... | 23.944444 | 52 | 0.651972 | from ...streams import EndianBinaryReader
class SerializedFileHeader:
metadataSize: int
fileSize: int
version: int
dataOffset: int
endian: bytes
reserved: bytes
def __init__(self, reader: EndianBinaryReader):
self.metadataSize = reader.readUInt()
self.fileSi... | true | true |
1c2defcad6eb30907b1195b71d0eb2c40d5b42ff | 4,390 | py | Python | analyses/utils.py | lukassnoek/MVCA | dd194140a5babb4605b9248d34508b9d9e4f799c | [
"MIT"
] | 11 | 2018-03-29T09:39:28.000Z | 2021-09-09T15:49:53.000Z | analyses/suppl_simulations/utils.py | lukassnoek/MVCA | dd194140a5babb4605b9248d34508b9d9e4f799c | [
"MIT"
] | 2 | 2021-02-04T11:10:34.000Z | 2022-03-07T14:41:54.000Z | analyses/suppl_simulations/utils.py | lukassnoek/MVCA | dd194140a5babb4605b9248d34508b9d9e4f799c | [
"MIT"
] | 3 | 2018-04-12T09:11:31.000Z | 2018-11-30T10:17:54.000Z | import numpy as np
from scipy.special import hyp2f1, gammaln
def get_r2(iv, dv, stack_intercept=True):
""" Regress dv onto iv and return r-squared.
Parameters
----------
iv : numpy array
Array of shape N (samples) x K (features)
dv : numpy array
Array of shape N (samples) x 1
... | 29.463087 | 102 | 0.580182 | import numpy as np
from scipy.special import hyp2f1, gammaln
def get_r2(iv, dv, stack_intercept=True):
if iv.ndim == 1:
iv = iv[:, np.newaxis]
if stack_intercept:
iv = np.hstack((np.ones((iv.shape[0], 1)), iv))
beta = np.linalg.lstsq(iv, dv)[0]
dv_hat = iv.dot(b... | true | true |
1c2df018e40f65e521e67b3ef8b247d491b3a2e4 | 1,628 | py | Python | Tetris/events.py | Yatsuuw/Jeux-Python | 3c9bce9f41b537897ea88ef1fe329be6820ab7aa | [
"MIT"
] | null | null | null | Tetris/events.py | Yatsuuw/Jeux-Python | 3c9bce9f41b537897ea88ef1fe329be6820ab7aa | [
"MIT"
] | null | null | null | Tetris/events.py | Yatsuuw/Jeux-Python | 3c9bce9f41b537897ea88ef1fe329be6820ab7aa | [
"MIT"
] | null | null | null | import pygame
from sys import exit
# écouter chaque événement et réagir
def check_events(sqs, status, AI):
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
if event.type == pygame.KEYDOWN:
key_down(sqs, event.key, status)
if event.type == pygame.... | 29.071429 | 47 | 0.60688 | import pygame
from sys import exit
def check_events(sqs, status, AI):
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
if event.type == pygame.KEYDOWN:
key_down(sqs, event.key, status)
if event.type == pygame.KEYUP:
key_up(event.key,... | true | true |
1c2df1ce4dc3ae3a428f9f69916080e0009f64ea | 29,376 | py | Python | sphinxcontrib/matlab.py | ilent2/matlabdomain | 73776457ca0f81266de9ada227354e4322a92bbe | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/matlab.py | ilent2/matlabdomain | 73776457ca0f81266de9ada227354e4322a92bbe | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/matlab.py | ilent2/matlabdomain | 73776457ca0f81266de9ada227354e4322a92bbe | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinxcontrib.matlab
~~~~~~~~~~~~~~~~~~~~
The MATLAB domain.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import absolute_import, unicode_literals
from . import mat_documenters as doc
from .... | 38.150649 | 92 | 0.542382 |
from __future__ import absolute_import, unicode_literals
from . import mat_documenters as doc
from . import mat_directives
import re
from docutils import nodes
from docutils.parsers.rst import directives, Directive
from sphinx import addnodes
from sphinx.roles import XRefRole
from sphinx.locale import _
from sphinx... | true | true |
1c2df23cd27c41834a1e60dfbcd69a296561cd37 | 19,531 | py | Python | boxUpdate/boxUpdate.py | bobofei/Mohou_Box-master | 3d1c320a6258422406e2ba2f96ec7986beba1330 | [
"Apache-2.0"
] | null | null | null | boxUpdate/boxUpdate.py | bobofei/Mohou_Box-master | 3d1c320a6258422406e2ba2f96ec7986beba1330 | [
"Apache-2.0"
] | null | null | null | boxUpdate/boxUpdate.py | bobofei/Mohou_Box-master | 3d1c320a6258422406e2ba2f96ec7986beba1330 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf8')
#sys.path.append("/home/pi/oprint/lib/python2.7/site-packages/tornado-4.0.1-py2.7-linux-armv7l.egg/")
#sys.path.append("/home/pi/oprint/lib/python2.7/site-packages/backports.ssl_match_hostname-3.4.0.2-py2.7.egg/")
imp... | 45.526807 | 176 | 0.584711 |
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import uuid
import hashlib
import time
import logging
import os
import urllib
import httplib
import json
import md5
from tornado.httpclient import HTTPClient
from tornad... | true | true |
1c2df3dddda4b02ec9b4bef2f12046d3516e3362 | 358 | py | Python | sboapp/migrations/0002_auto_20180504_0704.py | tmaunier/sboucru | c01c34f909fb89b9eb35c476ff4ac595116ad024 | [
"MIT"
] | 3 | 2020-11-18T10:11:40.000Z | 2021-11-08T08:48:05.000Z | sboapp/migrations/0002_auto_20180504_0704.py | tmaunier/sboucru | c01c34f909fb89b9eb35c476ff4ac595116ad024 | [
"MIT"
] | 3 | 2020-06-05T18:42:49.000Z | 2021-06-10T20:42:06.000Z | sboapp/migrations/0002_auto_20180504_0704.py | tmaunier/sboucru | c01c34f909fb89b9eb35c476ff4ac595116ad024 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-05-04 07:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sboapp', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='serum',
old_name='birth_date',
ne... | 18.842105 | 47 | 0.578212 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sboapp', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='serum',
old_name='birth_date',
new_name='birth_year',
),
]
| true | true |
1c2df4f095a2a8b079e34af579926a63403363c4 | 5,467 | py | Python | tg/request_local.py | devilicecream/tg2 | 0aadc0d1595e7326b187deb7b0198de1715225b0 | [
"MIT"
] | null | null | null | tg/request_local.py | devilicecream/tg2 | 0aadc0d1595e7326b187deb7b0198de1715225b0 | [
"MIT"
] | null | null | null | tg/request_local.py | devilicecream/tg2 | 0aadc0d1595e7326b187deb7b0198de1715225b0 | [
"MIT"
] | null | null | null | import hmac, base64, binascii, re
from tg.support.objectproxy import TurboGearsObjectProxy
from tg.support.registry import StackedObjectProxy, DispatchingConfig
from tg.caching import cached_property
try:
import cPickle as pickle
except ImportError: #pragma: no cover
import pickle
try:
from hashlib import... | 31.601156 | 115 | 0.674227 | import hmac, base64, binascii, re
from tg.support.objectproxy import TurboGearsObjectProxy
from tg.support.registry import StackedObjectProxy, DispatchingConfig
from tg.caching import cached_property
try:
import cPickle as pickle
except ImportError:
import pickle
try:
from hashlib import sha1
except Impo... | true | true |
1c2df54ecc53525de3e6db310a0b230620103196 | 14,415 | py | Python | tests/storage/test_client_ips.py | rhetenor/synapse | 5154afc00d841c7685a97700be3cd1398e633e05 | [
"Apache-2.0"
] | 7 | 2020-07-03T13:51:31.000Z | 2022-03-10T01:26:18.000Z | tests/storage/test_client_ips.py | rhetenor/synapse | 5154afc00d841c7685a97700be3cd1398e633e05 | [
"Apache-2.0"
] | 69 | 2019-09-09T13:54:30.000Z | 2022-03-23T10:45:15.000Z | tests/storage/test_client_ips.py | rhetenor/synapse | 5154afc00d841c7685a97700be3cd1398e633e05 | [
"Apache-2.0"
] | 7 | 2020-04-24T17:04:40.000Z | 2021-07-29T23:06:25.000Z | # Copyright 2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.405229 | 87 | 0.549636 |
from unittest.mock import Mock
import synapse.rest.admin
from synapse.http.site import XForwardedForRequest
from synapse.rest.client import login
from tests import unittest
from tests.server import make_request
from tests.test_utils import make_awaitable
from tests.unittest import override_config
cla... | true | true |
1c2df59b3624e83309ba6fde19949ccfe728cf89 | 689 | py | Python | Scripts/django-admin.py | narsimrao/django_project | 8bd6b3db69505bfc7c78de9e58058efe76505485 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/django-admin.py | narsimrao/django_project | 8bd6b3db69505bfc7c78de9e58058efe76505485 | [
"bzip2-1.0.6"
] | null | null | null | Scripts/django-admin.py | narsimrao/django_project | 8bd6b3db69505bfc7c78de9e58058efe76505485 | [
"bzip2-1.0.6"
] | null | null | null | #!e:\django_projects\django_project\scripts\python.exe
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was depr... | 31.318182 | 80 | 0.730044 |
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was deprecated in Django 3.1 and removed in Django '
'4.0. Please manually remove this script from your virtual enviro... | true | true |
1c2df5d2de5204cd63985ec98a49fd4203a2d6d0 | 26,046 | py | Python | lib/pwiki/Utilities.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | 1 | 2016-09-24T19:15:24.000Z | 2016-09-24T19:15:24.000Z | lib/pwiki/Utilities.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | lib/pwiki/Utilities.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | from __future__ import with_statement
import threading, traceback, collections, heapq
from thread import allocate_lock as _allocate_lock
from time import time as _time, sleep as _sleep
import wx
from Consts import DEADBLOCKTIMEOUT
from .WikiExceptions import NotCurrentThreadException, \
DeadBlockPr... | 30.463158 | 93 | 0.543615 | from __future__ import with_statement
import threading, traceback, collections, heapq
from thread import allocate_lock as _allocate_lock
from time import time as _time, sleep as _sleep
import wx
from Consts import DEADBLOCKTIMEOUT
from .WikiExceptions import NotCurrentThreadException, \
DeadBlockPr... | false | true |
1c2df61a7417955bda87d8d71d299b279e8a2f26 | 1,103 | py | Python | utils/sputa.py | piger/dulbecco | 8d0c1a62d64214f1962077385216f09866767720 | [
"BSD-2-Clause"
] | null | null | null | utils/sputa.py | piger/dulbecco | 8d0c1a62d64214f1962077385216f09866767720 | [
"BSD-2-Clause"
] | null | null | null | utils/sputa.py | piger/dulbecco | 8d0c1a62d64214f1962077385216f09866767720 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cPickle as pickle
import shutil
import os
import json
import sys
class PersistentDict(dict):
def __init__(self, filename, *args, **kwargs):
self.filename = filename
dict.__init__(self, *args, **kwargs)
def save(self):
tmpfile = self... | 23.978261 | 53 | 0.55757 |
import cPickle as pickle
import shutil
import os
import json
import sys
class PersistentDict(dict):
def __init__(self, filename, *args, **kwargs):
self.filename = filename
dict.__init__(self, *args, **kwargs)
def save(self):
tmpfile = self.filename + ".tmp"
try:
... | true | true |
1c2df64db076a8bba366965c59793e8dbaeb6a13 | 882 | py | Python | esmvalcore/cmor/_fixes/cmip5/fgoals_g2.py | jvegreg/ESMValCore | 03eb1c942bf1dc3be98cb30c3592b42e82a94f16 | [
"Apache-2.0"
] | null | null | null | esmvalcore/cmor/_fixes/cmip5/fgoals_g2.py | jvegreg/ESMValCore | 03eb1c942bf1dc3be98cb30c3592b42e82a94f16 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:16:06.000Z | 2022-03-10T12:58:49.000Z | esmvalcore/cmor/_fixes/cmip5/fgoals_g2.py | valeriupredoi/ESMValCore | b46b948c47d8579d997b28501f8588f5531aa354 | [
"Apache-2.0"
] | null | null | null | """Fixes for FGOALS-g2 model."""
import iris
from cf_units import Unit
from ..fix import Fix
from ..shared import round_coordinates
class AllVars(Fix):
"""Fixes for all variables."""
def fix_metadata(self, cubes):
"""Fix metadata.
Fix time coordinate and round other coordinates to fix issue... | 22.615385 | 73 | 0.568027 | import iris
from cf_units import Unit
from ..fix import Fix
from ..shared import round_coordinates
class AllVars(Fix):
def fix_metadata(self, cubes):
for cube in cubes:
try:
time = cube.coord('time')
except iris.exceptions.CoordinateNotFoundError:
... | true | true |
1c2df64e53bd14b34a66a8f182d65708eb56769f | 195 | py | Python | BAEKJOON/Python/10773.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | BAEKJOON/Python/10773.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | BAEKJOON/Python/10773.py | cmsong111/NJ_code | 2df6176d179e168a2789a825ddeb977a82eb8d97 | [
"MIT"
] | null | null | null | result = []
for i in range(int(input())):
temp = int(input())
if temp == 0:
if len(result) != 0:
result.pop()
else:
result.append(temp)
print(sum(result)) | 19.5 | 29 | 0.507692 | result = []
for i in range(int(input())):
temp = int(input())
if temp == 0:
if len(result) != 0:
result.pop()
else:
result.append(temp)
print(sum(result)) | true | true |
1c2df69976a1483f6eb5b5dc7775f32a86fd296a | 313 | py | Python | packages/pycopy/v2.11.0.1/esp8266/stubs/uselect.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 18 | 2019-07-11T13:31:09.000Z | 2022-01-27T06:38:40.000Z | packages/pycopy/v2.11.0.1/esp8266/stubs/uselect.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 9 | 2019-09-01T21:44:49.000Z | 2022-02-04T20:55:08.000Z | packages/pycopy/v2.11.0.1/esp8266/stubs/uselect.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 6 | 2019-10-08T05:31:21.000Z | 2021-04-22T10:21:01.000Z | """
Module: 'uselect' on esp8266 v2.11.0.1 on 2019
"""
# MCU: (sysname='esp8266', nodename='esp8266', release='2.2.0-dev(9422289)', version='v2.11.0.1 on 2019-07-26', machine='ESP module with ESP8266')
# Stubber: 1.2.0
POLLERR = 8
POLLHUP = 16
POLLIN = 1
POLLOUT = 4
def poll():
pass
def select():
pass
| 19.5625 | 146 | 0.645367 |
POLLERR = 8
POLLHUP = 16
POLLIN = 1
POLLOUT = 4
def poll():
pass
def select():
pass
| true | true |
1c2df8007af113fc464b9a79dc28207ab10a761d | 227 | py | Python | image-processing-package/image-processing-my-package/utils/io.py | isabellazramos/criacao-de-pacotes-em-python | 6ee97f1365813832bd530f0df6e2159c5b2cb06d | [
"MIT"
] | null | null | null | image-processing-package/image-processing-my-package/utils/io.py | isabellazramos/criacao-de-pacotes-em-python | 6ee97f1365813832bd530f0df6e2159c5b2cb06d | [
"MIT"
] | null | null | null | image-processing-package/image-processing-my-package/utils/io.py | isabellazramos/criacao-de-pacotes-em-python | 6ee97f1365813832bd530f0df6e2159c5b2cb06d | [
"MIT"
] | 2 | 2022-03-21T20:15:46.000Z | 2022-03-31T14:50:43.000Z | #Author: Karina Tiemi Kato
from skimage.io import inread, insave
def read_image(path, is_gray = False):
image = inread(path, as_gray = is_gray)
return image
def save_image(image, path):
insave(path, image) | 25.222222 | 44 | 0.696035 |
from skimage.io import inread, insave
def read_image(path, is_gray = False):
image = inread(path, as_gray = is_gray)
return image
def save_image(image, path):
insave(path, image) | true | true |
1c2df8a4ae9fd16c06a3de5c0f9723cea7c360e8 | 7,052 | py | Python | flloat/flloat.py | marcofavorito/flloat | 75e8ec9219763eba5feb362438604693b6cc7346 | [
"Apache-2.0"
] | 3 | 2019-07-14T21:15:26.000Z | 2019-12-12T21:51:35.000Z | flloat/flloat.py | MarcoFavorito/flloat | 75e8ec9219763eba5feb362438604693b6cc7346 | [
"MIT"
] | 1 | 2019-09-03T16:35:59.000Z | 2019-09-03T16:35:59.000Z | flloat/flloat.py | MarcoFavorito/flloat | 75e8ec9219763eba5feb362438604693b6cc7346 | [
"MIT"
] | 1 | 2019-08-30T18:15:02.000Z | 2019-08-30T18:15:02.000Z | # -*- coding: utf-8 -*-
"""Main module of the pakage."""
from typing import Set, FrozenSet, Dict, cast, List
import sympy
from pythomata import SymbolicAutomaton, PropositionalInterpretation
from pythomata.impl.symbolic import SymbolicDFA
from sympy.logic.boolalg import BooleanFalse
from flloat.base import Formula
... | 32.497696 | 87 | 0.617413 |
from typing import Set, FrozenSet, Dict, cast, List
import sympy
from pythomata import SymbolicAutomaton, PropositionalInterpretation
from pythomata.impl.symbolic import SymbolicDFA
from sympy.logic.boolalg import BooleanFalse
from flloat.base import Formula
from flloat.delta import Delta
from flloat.helpers impor... | true | true |
1c2df8d4702fe1cbbe53da69f75b40db9ac2ed4c | 2,100 | py | Python | lib/bes/fs/file_metadata.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/file_metadata.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/file_metadata.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import os
import os.path as path
from bes.common.check import check
from bes.sqlite.sqlite import sqlite
from bes.fs.file_util import file_util
from .detail.file_metadata_db import file_metadata_db
class file_metadata(object):... | 33.333333 | 96 | 0.741429 |
import os
import os.path as path
from bes.common.check import check
from bes.sqlite.sqlite import sqlite
from bes.fs.file_util import file_util
from .detail.file_metadata_db import file_metadata_db
class file_metadata(object):
DEFAULT_DB_FILENAME = '.bes_file_metadata.db'
def __init__(self, root_dir, db_fil... | true | true |
1c2df8d6876849a9a0dc4d55bdff271a4397f835 | 4,006 | py | Python | app_data2.py | rongqingpin/iOS_app_data | c9beecfb3878f64568b1d9626412ba6b346934cd | [
"MIT"
] | null | null | null | app_data2.py | rongqingpin/iOS_app_data | c9beecfb3878f64568b1d9626412ba6b346934cd | [
"MIT"
] | null | null | null | app_data2.py | rongqingpin/iOS_app_data | c9beecfb3878f64568b1d9626412ba6b346934cd | [
"MIT"
] | null | null | null | import pandas as pd
import csv
import json
import re
# load the category IDs
flc = '/Users/pinqingkan/Desktop/Codes/Project_iTunes/'
#flc = '/Users/Melanie/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Codes/Project_iTunes/'
fname = flc + 'IDs/iosapp_categories.csv'
X0 = pd.read_csv(fname)
# remove repetitive o... | 38.152381 | 117 | 0.507239 | import pandas as pd
import csv
import json
import re
flc = '/Users/pinqingkan/Desktop/Codes/Project_iTunes/'
fname = flc + 'IDs/iosapp_categories.csv'
X0 = pd.read_csv(fname)
X0 = X0.drop(labels = [7, 28, 67], axis = 0)
Ncatg, N = X0.shape
app_keys = ['trackId',
'artistId',
'artistViewUrl... | true | true |
1c2df98873fe0c0b722513464ffa00ef6d1ec3c8 | 9,758 | py | Python | userbot/plugins/pmpermit_menu.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/pmpermit_menu.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | userbot/plugins/pmpermit_menu.py | midhunkm1294-bit/TeleBot | b4309fb662e834d9d3826172b69fd07d42ef83a2 | [
"MIT"
] | null | null | null | # if you change credits, you get anal cancer and get murdered by russians in 3 days.
"""
Support chatbox for pmpermit.
Used by incoming messages with trigger as /start
Will not work for already approved people.
Credits: written by TONY STARK {@MARIODEVS}
"""
import asyncio
import io
import telethon.sync
from telethon.... | 58.431138 | 441 | 0.563435 |
import asyncio
import io
import telethon.sync
from telethon.tl.functions.users import GetFullUserRequest
import userbot.plugins.sql_helper.pmpermit_sql as pmpermit_sql
from telethon import events, errors, functions, types
from userbot import ALIVE_NAME, LESS_SPAMMY
from userbot.utils import admin_cmd
DEFAULTUSER = ... | true | true |
1c2df992be4a199d35b73f2d802812983d8cdbe0 | 332 | py | Python | nltk/test/inference_fixt.py | smoitra87/nltk | ca357e5cdcdb137f40c45346bb8bfea618dd863f | [
"Apache-2.0"
] | 1 | 2020-07-08T11:26:30.000Z | 2020-07-08T11:26:30.000Z | nltk/test/inference_fixt.py | smoitra87/nltk | ca357e5cdcdb137f40c45346bb8bfea618dd863f | [
"Apache-2.0"
] | null | null | null | nltk/test/inference_fixt.py | smoitra87/nltk | ca357e5cdcdb137f40c45346bb8bfea618dd863f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def setup_module(module):
from nose import SkipTest
from nltk.inference.mace import Mace
try:
m = Mace()
m._find_binary("mace4")
except LookupError as e:
raise SkipTest(
"Mace4/Prover9 is not available so inference.doctest was skipped"
... | 22.133333 | 77 | 0.608434 |
def setup_module(module):
from nose import SkipTest
from nltk.inference.mace import Mace
try:
m = Mace()
m._find_binary("mace4")
except LookupError as e:
raise SkipTest(
"Mace4/Prover9 is not available so inference.doctest was skipped"
) from e
| true | true |
1c2df9b8f6859080126268a91f1ad831ed89e337 | 517 | py | Python | Non-graded algorithm implementations (week 1)/Selection Sort.py | TheRevanchist/Design-and-Analysis-of-Algorithms-Part-1 | e41e3a1117258fb6f635c3c734675215dbce5263 | [
"MIT"
] | 1 | 2020-08-02T12:01:56.000Z | 2020-08-02T12:01:56.000Z | Non-graded algorithm implementations (week 1)/Selection Sort.py | TheRevanchist/Design-and-Analysis-of-Algorithms-Part-1 | e41e3a1117258fb6f635c3c734675215dbce5263 | [
"MIT"
] | null | null | null | Non-graded algorithm implementations (week 1)/Selection Sort.py | TheRevanchist/Design-and-Analysis-of-Algorithms-Part-1 | e41e3a1117258fb6f635c3c734675215dbce5263 | [
"MIT"
] | null | null | null | def selectionSort(A):
# input: a list of unsorted numbers
# output: the list of sorted numbers using selection-sort algorithm
for i in range(len(A)):
minimum = i
for j in range(i+1, len(A)):
if A[j] < A[minimum]:
minimum = j
... | 27.210526 | 72 | 0.464217 | def selectionSort(A):
for i in range(len(A)):
minimum = i
for j in range(i+1, len(A)):
if A[j] < A[minimum]:
minimum = j
temp = A[i]
A[i] = A[minimum]
A[minimum] = temp
return A
L =... | false | true |
1c2dfb973cecc953979c917b147c635120afc5ab | 6,710 | py | Python | pyEX/stocks/batch.py | cjwang/pyEX | 1b5f40f80110afaa4809ea48fac067033c7bdf89 | [
"Apache-2.0"
] | 1 | 2020-10-11T07:05:49.000Z | 2020-10-11T07:05:49.000Z | pyEX/stocks/batch.py | cjwang/pyEX | 1b5f40f80110afaa4809ea48fac067033c7bdf89 | [
"Apache-2.0"
] | null | null | null | pyEX/stocks/batch.py | cjwang/pyEX | 1b5f40f80110afaa4809ea48fac067033c7bdf89 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import itertools
import pandas as pd
from multiprocessing.pool import ThreadPool
from ..common import _TIMEFRAME_CHART, _getJson, _raiseIfNotStr, PyEXception, _strOrDate, _toDatetime, _BATCH_TYPES
from .fundamentals import _dividendsToDF, _earningsToDF, _financialsToDF, _splitsToDF
from .news im... | 31.209302 | 127 | 0.619821 |
import itertools
import pandas as pd
from multiprocessing.pool import ThreadPool
from ..common import _TIMEFRAME_CHART, _getJson, _raiseIfNotStr, PyEXception, _strOrDate, _toDatetime, _BATCH_TYPES
from .fundamentals import _dividendsToDF, _earningsToDF, _financialsToDF, _splitsToDF
from .news import _newsToDF
from .pr... | true | true |
1c2dfce3b790c8a524ac769021eb8e657cc7add7 | 3,816 | py | Python | UnityPy/math/Vector3.py | hydrargyrum/UnityPy | d119f5a27fa56270630ff40d7762cdf9b4abbac3 | [
"MIT"
] | null | null | null | UnityPy/math/Vector3.py | hydrargyrum/UnityPy | d119f5a27fa56270630ff40d7762cdf9b4abbac3 | [
"MIT"
] | null | null | null | UnityPy/math/Vector3.py | hydrargyrum/UnityPy | d119f5a27fa56270630ff40d7762cdf9b4abbac3 | [
"MIT"
] | null | null | null | class Vector3:
def __init__(self, x : float, y : float, z : float):
self.X = x
self.Y = y
self.Z = z
"""
using System;
using System.Runtime.InteropServices;
namespace AssetStudio
{
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public struct Vector3 : IEquatable<Vector3>
{
public float X;
... | 24.941176 | 108 | 0.446803 | class Vector3:
def __init__(self, x : float, y : float, z : float):
self.X = x
self.Y = y
self.Z = z
| true | true |
1c2dfd57a1efc1a0c1debe4d4a7acaa87383ef5d | 61 | py | Python | auth_main/__init__.py | ajskrilla/PAS_pw_check | 056b09e2975b7e1d00c81180d4bdd71bfac91b4d | [
"Apache-2.0"
] | null | null | null | auth_main/__init__.py | ajskrilla/PAS_pw_check | 056b09e2975b7e1d00c81180d4bdd71bfac91b4d | [
"Apache-2.0"
] | null | null | null | auth_main/__init__.py | ajskrilla/PAS_pw_check | 056b09e2975b7e1d00c81180d4bdd71bfac91b4d | [
"Apache-2.0"
] | null | null | null | #from auth import saveConfig
#from auth_check import sec_test | 30.5 | 32 | 0.852459 | true | true | |
1c2dfe22798ba84d8d56669e7d65e0ff7e5d5fff | 38,583 | py | Python | graph_ZSL_w_argmin.py | kfirsalo/New-Graph-ZSL | 76ccd15e65e915858dca9d9097ddf9252e4250d3 | [
"MIT"
] | null | null | null | graph_ZSL_w_argmin.py | kfirsalo/New-Graph-ZSL | 76ccd15e65e915858dca9d9097ddf9252e4250d3 | [
"MIT"
] | null | null | null | graph_ZSL_w_argmin.py | kfirsalo/New-Graph-ZSL | 76ccd15e65e915858dca9d9097ddf9252e4250d3 | [
"MIT"
] | null | null | null | import json
import multiprocessing
from datetime import datetime
from node2vec import Node2Vec
import pandas as pd
import numpy as np
import networkx as nx
import pickle
import os
import argparse
from numpy import linalg as la
from sklearn.metrics.pairwise import cosine_similarity
from sklearn import model_selection a... | 46.995128 | 165 | 0.61509 | import json
import multiprocessing
from datetime import datetime
from node2vec import Node2Vec
import pandas as pd
import numpy as np
import networkx as nx
import pickle
import os
import argparse
from numpy import linalg as la
from sklearn.metrics.pairwise import cosine_similarity
from sklearn import model_selection a... | true | true |
1c2dfe42c5f11130ad1de80135a4af445e0dabd3 | 927 | py | Python | overwatch/database/zodbDatabaseFactory.py | ostr00000/OVERWATCH | ebf69402b9b1b9e3b92cb96f013692072c2c69f2 | [
"BSD-3-Clause"
] | null | null | null | overwatch/database/zodbDatabaseFactory.py | ostr00000/OVERWATCH | ebf69402b9b1b9e3b92cb96f013692072c2c69f2 | [
"BSD-3-Clause"
] | null | null | null | overwatch/database/zodbDatabaseFactory.py | ostr00000/OVERWATCH | ebf69402b9b1b9e3b92cb96f013692072c2c69f2 | [
"BSD-3-Clause"
] | null | null | null | """
.. code-author: Mateusz Piwowarczyk <>, AGH University of Science and Technology
"""
import zodburi
import ZODB
from overwatch.database.databaseFactory import DatabaseFactory
from overwatch.database.zodbDatabase import ZodbDatabase
class ZodbDatabaseFactory(DatabaseFactory):
def __init__(self, databaseLocati... | 34.333333 | 88 | 0.713053 | import zodburi
import ZODB
from overwatch.database.databaseFactory import DatabaseFactory
from overwatch.database.zodbDatabase import ZodbDatabase
class ZodbDatabaseFactory(DatabaseFactory):
def __init__(self, databaseLocation):
DatabaseFactory.__init__(self)
self.databaseLocation = databaseLocat... | true | true |
1c2dfee0ea5f54665c78d07cdd3c70525819729b | 512 | py | Python | src/appointments_has_payment/models.py | TheCleverlaure/sicco-web | 8e734c9bfa9c99056b6abd5276b65b1e4bf21e23 | [
"bzip2-1.0.6"
] | null | null | null | src/appointments_has_payment/models.py | TheCleverlaure/sicco-web | 8e734c9bfa9c99056b6abd5276b65b1e4bf21e23 | [
"bzip2-1.0.6"
] | null | null | null | src/appointments_has_payment/models.py | TheCleverlaure/sicco-web | 8e734c9bfa9c99056b6abd5276b65b1e4bf21e23 | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
from appointments.models import Citas
from payment.models import Pago
class CitaTienePago(models.Model):
cod_cita = models.ForeignKey(Citas, models.CASCADE, db_column='Cod_Cita', primary_key=True) # Field name made lowercase.
cod_pago = models.ForeignKey(Pago, models.CASCADE, db_c... | 39.384615 | 125 | 0.728516 | from django.db import models
from appointments.models import Citas
from payment.models import Pago
class CitaTienePago(models.Model):
cod_cita = models.ForeignKey(Citas, models.CASCADE, db_column='Cod_Cita', primary_key=True)
cod_pago = models.ForeignKey(Pago, models.CASCADE, db_column='Cod_Pago', unique=Tru... | true | true |
1c2dfef350f1f5adf949de096b36c9f0f279a120 | 2,696 | py | Python | addons/io_scene_swbf_msh/msh_model_triangle_strips.py | WHSnyder/SWBF-msh-Blender-Export | b56fa79a1967cdfc8c9b7928a2e5c2f7e940b289 | [
"Apache-2.0"
] | 7 | 2019-12-27T04:07:56.000Z | 2021-11-14T22:04:32.000Z | addons/io_scene_swbf_msh/msh_model_triangle_strips.py | WHSnyder/SWBF-msh-Blender-Export | b56fa79a1967cdfc8c9b7928a2e5c2f7e940b289 | [
"Apache-2.0"
] | null | null | null | addons/io_scene_swbf_msh/msh_model_triangle_strips.py | WHSnyder/SWBF-msh-Blender-Export | b56fa79a1967cdfc8c9b7928a2e5c2f7e940b289 | [
"Apache-2.0"
] | 3 | 2019-11-23T09:07:21.000Z | 2020-10-06T16:22:49.000Z | """ Contains triangle strip generation functions for GeometrySegment. """
from typing import List, Tuple
from copy import deepcopy
from .msh_model import *
def create_models_triangle_strips(models: List[Model]) -> List[Model]:
""" Create the triangle strips for a list of models geometry. """
for model in mod... | 32.878049 | 98 | 0.592359 |
from typing import List, Tuple
from copy import deepcopy
from .msh_model import *
def create_models_triangle_strips(models: List[Model]) -> List[Model]:
for model in models:
if model.geometry is not None:
for segment in model.geometry:
segment.triangle_strips = create_triangle... | true | true |
1c2e006454f1729f6cbb17222e43a1991f558056 | 852 | py | Python | ore_combinators/combinators/string.py | kraglik/ore | fca49bb8cd46bcdf3a6c8cde65cf6aed9a0bd741 | [
"MIT"
] | 1 | 2021-06-09T13:45:47.000Z | 2021-06-09T13:45:47.000Z | ore_combinators/combinators/string.py | kraglik/ore | fca49bb8cd46bcdf3a6c8cde65cf6aed9a0bd741 | [
"MIT"
] | null | null | null | ore_combinators/combinators/string.py | kraglik/ore | fca49bb8cd46bcdf3a6c8cde65cf6aed9a0bd741 | [
"MIT"
] | null | null | null | from typing import Tuple, Any
from ore_combinators.combinator import combinator
from ore_combinators.parser_state import ParserState
from ore_combinators.result import Result
from ore_combinators.error import ParserError, EndOfFileError
class string(combinator): # noqa
def __init__(self, s: str):
self.... | 29.37931 | 70 | 0.647887 | from typing import Tuple, Any
from ore_combinators.combinator import combinator
from ore_combinators.parser_state import ParserState
from ore_combinators.result import Result
from ore_combinators.error import ParserError, EndOfFileError
class string(combinator):
def __init__(self, s: str):
self._strin... | true | true |
1c2e015a72b7b341f0a82c3c4414419aa6b738bc | 9,328 | py | Python | healthyForce/MTLModels.py | HypnosPy/HypnosPy | 28b17d07ee78f7714bbbbd66f6253764addf9d94 | [
"MIT"
] | 4 | 2022-01-02T18:40:57.000Z | 2022-02-17T12:59:57.000Z | healthyForce/MTLModels.py | ippozuelo/HypnosPy | 28b17d07ee78f7714bbbbd66f6253764addf9d94 | [
"MIT"
] | 2 | 2020-11-11T07:13:56.000Z | 2020-11-11T07:38:54.000Z | healthyForce/MTLModels.py | ippozuelo/HypnosPy | 28b17d07ee78f7714bbbbd66f6253764addf9d94 | [
"MIT"
] | 2 | 2020-11-24T22:46:31.000Z | 2021-02-05T16:43:12.000Z | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
class MTL:
def __init__(self):
pass
def aggregate_losses(self, losses):
pass
def adjust_after_validation(self, losses, epoch):
pass
class MTLRandom(MTL):
def __init__(self, ntasks, verbose=1):
... | 35.603053 | 113 | 0.547491 | import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
class MTL:
def __init__(self):
pass
def aggregate_losses(self, losses):
pass
def adjust_after_validation(self, losses, epoch):
pass
class MTLRandom(MTL):
def __init__(self, ntasks, verbose=1):
... | true | true |
1c2e015f2562f36b943e25339f4dc74362fc5ebc | 25,303 | py | Python | source/code/handlers/execution_handler.py | awslabs/aws-ops-automator | 362abd0717b48ecca7f20d8985ae7d76f045daf3 | [
"Apache-2.0"
] | 94 | 2017-08-01T05:28:45.000Z | 2021-09-10T07:18:46.000Z | source/code/handlers/execution_handler.py | aws-solutions/aws-ops-automator | 362abd0717b48ecca7f20d8985ae7d76f045daf3 | [
"Apache-2.0"
] | 27 | 2018-02-15T17:14:09.000Z | 2021-04-27T11:28:42.000Z | source/code/handlers/execution_handler.py | awslabs/aws-ops-automator | 362abd0717b48ecca7f20d8985ae7d76f045daf3 | [
"Apache-2.0"
] | 50 | 2017-08-01T05:29:04.000Z | 2021-08-11T20:09:07.000Z | ######################################################################################################################
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | 50.50499 | 130 | 0.588152 | on_id=self.action_id,
task=self.task,
task_metrics=self.metrics,
status=handlers.STATUS_WAIT_FOR_COMPLETION,
status_data={
... | true | true |
1c2e01b39bd7c410b1525225e5bc812b3db81274 | 64,988 | py | Python | ansible_runner/interface.py | AlanCoding/ansible-runner | 4c6b7d0c15c62159f971522a23e4491487703472 | [
"Apache-2.0"
] | 1 | 2022-02-19T05:07:09.000Z | 2022-02-19T05:07:09.000Z | ansible_runner/interface.py | aknochow/ansible-runner | 996a00dd0cd449e129a693e53b73770a6de34e36 | [
"Apache-2.0"
] | null | null | null | ansible_runner/interface.py | aknochow/ansible-runner | 996a00dd0cd449e129a693e53b73770a6de34e36 | [
"Apache-2.0"
] | 1 | 2021-11-22T16:03:11.000Z | 2021-11-22T16:03:11.000Z | # Copyright (c) 2016 Ansible by Red Hat, Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | 66.928939 | 159 | 0.719471 |
import os
import json
import sys
import threading
import logging
from ansible_runner import output
from ansible_runner.config.runner import RunnerConfig
from ansible_runner.config.command import CommandConfig
from ansible_runner.config.inventory import InventoryConfig
from ansible_runner.config.ansi... | true | true |
1c2e0224eddb941725f123b7e5a73c2869f807cd | 1,911 | py | Python | var/spack/repos/builtin/packages/libnotify/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/libnotify/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/libnotify/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Libnotify(MesonPackage):
"""libnotify is a library for sending desktop notificatio... | 32.948276 | 95 | 0.632653 |
from spack.package import *
class Libnotify(MesonPackage):
homepage = "https://github.com/GNOME/libnotify"
url = "https://github.com/GNOME/libnotify/archive/0.7.9.tar.gz"
version('0.7.9', sha256='9bd4f5fa911d27567e7cc2d2d09d69356c16703c4e8d22c0b49a5c45651f3af0')
... | true | true |
1c2e0332d2980ce4a16bec4961c875df673783a2 | 1,624 | py | Python | HackerRank/Interview Preparation Kit/Dictionaries and Hashmaps/Hash Tables: Ransom Note/solution.py | ltdangkhoa/Computer-Science-Fundamental | b70ba714e1dd13fcb377125e047c5fc08d3a82b3 | [
"MIT"
] | null | null | null | HackerRank/Interview Preparation Kit/Dictionaries and Hashmaps/Hash Tables: Ransom Note/solution.py | ltdangkhoa/Computer-Science-Fundamental | b70ba714e1dd13fcb377125e047c5fc08d3a82b3 | [
"MIT"
] | null | null | null | HackerRank/Interview Preparation Kit/Dictionaries and Hashmaps/Hash Tables: Ransom Note/solution.py | ltdangkhoa/Computer-Science-Fundamental | b70ba714e1dd13fcb377125e047c5fc08d3a82b3 | [
"MIT"
] | null | null | null | """solution.py"""
import math
import os
import random
import re
import sys
import timeit
# from collections import Counter
def checkMagazine(magazine, note):
"""
O(nk)
To be improved: build a hash function to store keywords as numeric
Much more simpler with built-in Python: using collections Counter... | 25.375 | 73 | 0.595443 |
import math
import os
import random
import re
import sys
import timeit
def checkMagazine(magazine, note):
dict_magazine = {}
for word in magazine:
if not word in dict_magazine:
dict_magazine[word] = 1
else:
dict_magazine[word] += 1
can_repli... | true | true |
1c2e054ce3389cb1f00d39e8b788777118c75d52 | 793 | py | Python | test_data/files/paramatrized_test.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | 4 | 2021-07-10T15:21:01.000Z | 2021-07-17T12:11:06.000Z | test_data/files/paramatrized_test.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | 47 | 2021-07-12T13:59:19.000Z | 2022-01-31T20:49:03.000Z | test_data/files/paramatrized_test.py | aleksul/pytest-motor | 20dd246fce777f0e21d1d03244e494e818a3dd52 | [
"MIT"
] | 4 | 2021-07-13T19:38:47.000Z | 2021-07-17T13:14:46.000Z | """A test file with a paramatrized test."""
from typing import Any, Dict
import pytest
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorCollection, AsyncIOMotorDatabase
@pytest.mark.asyncio
# yapf: disable
@pytest.mark.parametrize('document', [
({}),
({'foo': 'bar'}),
({'wibble': 'wobble'}... | 31.72 | 99 | 0.64691 | from typing import Any, Dict
import pytest
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorCollection, AsyncIOMotorDatabase
@pytest.mark.asyncio
@pytest.mark.parametrize('document', [
({}),
({'foo': 'bar'}),
({'wibble': 'wobble'}),
])
async def test_with_parametrization(motor_client: As... | true | true |
1c2e0552fb92d2d6b2fe226d4ae42a3dcd9204c9 | 2,563 | py | Python | Chap 3/ElifWorkSheet.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | Chap 3/ElifWorkSheet.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | Chap 3/ElifWorkSheet.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | #David Hickox
# Question 1
car = input("What kind of car do you drive?")
if car.lower() == "toyota" or car.lower() == "honda":
msg = "you drive a fuel efficient car!"
else:
msg = "you ruin the enviroment"
print(msg)
# Question 2
name = input("What is your name?")
savings = float(input("What is your savi... | 29.45977 | 120 | 0.65119 |
car = input("What kind of car do you drive?")
if car.lower() == "toyota" or car.lower() == "honda":
msg = "you drive a fuel efficient car!"
else:
msg = "you ruin the enviroment"
print(msg)
name = input("What is your name?")
savings = float(input("What is your savings account balance?"))
checking = fl... | true | true |
1c2e059a45fc0fd56329ecec30a7e9b124c7c602 | 4,735 | py | Python | awward/settings.py | ruthjomo/Awwardsapp | 8e2a517e569f788f803219a143f2ae9e5dedab13 | [
"Unlicense",
"MIT"
] | null | null | null | awward/settings.py | ruthjomo/Awwardsapp | 8e2a517e569f788f803219a143f2ae9e5dedab13 | [
"Unlicense",
"MIT"
] | null | null | null | awward/settings.py | ruthjomo/Awwardsapp | 8e2a517e569f788f803219a143f2ae9e5dedab13 | [
"Unlicense",
"MIT"
] | null | null | null | """
Django settings for awward project.
Generated by 'django-admin startproject' using Django 1.11.29.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
from path... | 25.456989 | 91 | 0.690602 |
from pathlib import Path
import os
import django_heroku
import dj_database_url
from decouple import config,Csv
EMAIL_USE_TLS = config('EMAIL_USE_TLS')
EMAIL_HOST = config('EMAIL_HOST')
EMAIL_PORT = config('EMAIL_PORT')
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
M... | true | true |
1c2e063141aeb825b131ec6f67df244c6f55158a | 878 | py | Python | openpyxl/chart/tests/test_updown_bars.py | nickpell/openpyxl | 160c730c419f3796d2208b05c3b26a2b2fc10eb1 | [
"MIT"
] | 6 | 2018-05-15T05:08:52.000Z | 2021-12-23T12:31:28.000Z | openpyxl/chart/tests/test_updown_bars.py | nickpell/openpyxl | 160c730c419f3796d2208b05c3b26a2b2fc10eb1 | [
"MIT"
] | 1 | 2019-08-27T15:27:48.000Z | 2019-08-27T15:27:48.000Z | openpyxl/chart/tests/test_updown_bars.py | nickpell/openpyxl | 160c730c419f3796d2208b05c3b26a2b2fc10eb1 | [
"MIT"
] | 6 | 2020-03-23T15:59:14.000Z | 2021-09-18T09:54:57.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2018 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def UpDownBars():
from ..updown_bars import UpDownBars
return UpDownBars
class TestUpDownBars:
d... | 23.105263 | 55 | 0.624146 | from __future__ import absolute_import
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def UpDownBars():
from ..updown_bars import UpDownBars
return UpDownBars
class TestUpDownBars:
def test_ctor(self, UpDownBars):
... | true | true |
1c2e06a6351fc97d87c161de796fe6027f0f7ea8 | 12,294 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps/user/tests/tests_view_UsersId.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps/user/tests/tests_view_UsersId.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps/user/tests/tests_view_UsersId.py | RignonNoel/django-init | 4f00ec5f9ad8083a8dea5483c4e43712fceeba7a | [
"MIT"
] | 1 | 2019-11-20T17:24:33.000Z | 2019-11-20T17:24:33.000Z | import json
from rest_framework import status
from rest_framework.test import APIClient, APITestCase
from django.urls import reverse
from {{cookiecutter.project_slug}}.factories import UserFactory, AdminFactory
from {{cookiecutter.project_slug}}.testClasses import SerializerTestCase
class UsersIdTests(SerializerTe... | 26.61039 | 79 | 0.549048 | import json
from rest_framework import status
from rest_framework.test import APIClient, APITestCase
from django.urls import reverse
from {{cookiecutter.project_slug}}.factories import UserFactory, AdminFactory
from {{cookiecutter.project_slug}}.testClasses import SerializerTestCase
class UsersIdTests(SerializerTe... | false | true |
1c2e06e968e9443337111c075182e95447ba19e6 | 937 | py | Python | BB/bbObjects/items/modules/bbJumpDriveModule.py | mwaitzman/GOF2BountyBot | b66026228b752b07ac4734ca74b60730dbd74995 | [
"MIT"
] | null | null | null | BB/bbObjects/items/modules/bbJumpDriveModule.py | mwaitzman/GOF2BountyBot | b66026228b752b07ac4734ca74b60730dbd74995 | [
"MIT"
] | null | null | null | BB/bbObjects/items/modules/bbJumpDriveModule.py | mwaitzman/GOF2BountyBot | b66026228b752b07ac4734ca74b60730dbd74995 | [
"MIT"
] | null | null | null | from . import bbModule
from ....bbConfig import bbData
class bbJumpDriveModule(bbModule.bbModule):
def __init__(self, name, aliases, value=0, wiki="", manufacturer="", icon="", emoji=""):
super(bbJumpDriveModule, self).__init__(name, aliases, value=value, wiki=wiki, manufacturer=manufacturer, icon=icon, em... | 52.055556 | 180 | 0.66809 | from . import bbModule
from ....bbConfig import bbData
class bbJumpDriveModule(bbModule.bbModule):
def __init__(self, name, aliases, value=0, wiki="", manufacturer="", icon="", emoji=""):
super(bbJumpDriveModule, self).__init__(name, aliases, value=value, wiki=wiki, manufacturer=manufacturer, icon=icon, em... | true | true |
1c2e06eb67387083caca4750c1afe4c37eb06687 | 3,053 | py | Python | python/classes-dealing-with-complex-numbers.py | blog-a1/hackeRRank | 72923ee08c8759bd5a10ba6c390b6755fe2bd2e2 | [
"MIT"
] | 1 | 2021-01-13T11:52:27.000Z | 2021-01-13T11:52:27.000Z | python/classes-dealing-with-complex-numbers.py | blog-a1/hackeRRank | 72923ee08c8759bd5a10ba6c390b6755fe2bd2e2 | [
"MIT"
] | null | null | null | python/classes-dealing-with-complex-numbers.py | blog-a1/hackeRRank | 72923ee08c8759bd5a10ba6c390b6755fe2bd2e2 | [
"MIT"
] | null | null | null |
from math import pow
class Complex(object):
def __init__(self, real, imaginary):
self.real=real
self.imaginary=imaginary
def __add__(self, no):
a=self.real+no.real
b=self.imaginary+no.imaginary
if a<0 and b<0:
return ("-%.2f-%.2fi"%(abs(a),abs(b)))
... | 34.303371 | 70 | 0.457255 |
from math import pow
class Complex(object):
def __init__(self, real, imaginary):
self.real=real
self.imaginary=imaginary
def __add__(self, no):
a=self.real+no.real
b=self.imaginary+no.imaginary
if a<0 and b<0:
return ("-%.2f-%.2fi"%(abs(a),abs(b)))
... | true | true |
1c2e089afd686ced49da2f85d95f318c20c156ee | 2,283 | py | Python | setup.py | powellc/hacklabs | c39f05cb9ea37e98260369c09a618e7870c61f3d | [
"BSD-3-Clause"
] | null | null | null | setup.py | powellc/hacklabs | c39f05cb9ea37e98260369c09a618e7870c61f3d | [
"BSD-3-Clause"
] | 9 | 2018-02-23T13:32:33.000Z | 2018-02-23T13:32:34.000Z | setup.py | powellc/hacklabs | c39f05cb9ea37e98260369c09a618e7870c61f3d | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
version = __import__('hacklabs').__version__
install_requires = [
'setuptools',
'Django==1.6.5',
'django-configurations==0.8',
'dj-database-url==0.3.0',
'pylibmc==1.3.0',
'boto==2.9.5... | 26.858824 | 59 | 0.599212 | from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
version = __import__('hacklabs').__version__
install_requires = [
'setuptools',
'Django==1.6.5',
'django-configurations==0.8',
'dj-database-url==0.3.0',
'pylibmc==1.3.0',
'boto==2.9.5... | true | true |
1c2e09fc76e4f17fe7097352772c5c54fd08d6fd | 5,351 | py | Python | deepspeech/frontend/augmentor/spec_augment.py | iclementine/DeepSpeech | d0635c6592a2e787ca296e15241e7371a83ca55f | [
"Apache-2.0"
] | 1 | 2021-05-14T23:27:13.000Z | 2021-05-14T23:27:13.000Z | deepspeech/frontend/augmentor/spec_augment.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | deepspeech/frontend/augmentor/spec_augment.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | # 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 appli... | 31.292398 | 87 | 0.58419 |
import numpy as np
from deepspeech.frontend.augmentor.base import AugmentorBase
from deepspeech.utils.log import Log
logger = Log(__name__).getlog()
class SpecAugmentor(AugmentorBase):
def __init__(self,
rng,
F,
T,
n_freq_masks,
... | true | true |
1c2e0a9cb74826110c9ce4eea4b5787e91935848 | 6,608 | py | Python | test/functional/wallet_txn_clone.py | HZapperz/JahCoin | 94f0e3f60a0846bc331f334ccab0642913b9b0bd | [
"MIT"
] | 13 | 2019-01-23T04:36:05.000Z | 2022-02-21T11:20:25.000Z | test/functional/wallet_txn_clone.py | songMW/bitcoin | 5eb32d23841bbcd8eaf7ba49dc4ddfd822bd4773 | [
"MIT"
] | null | null | null | test/functional/wallet_txn_clone.py | songMW/bitcoin | 5eb32d23841bbcd8eaf7ba49dc4ddfd822bd4773 | [
"MIT"
] | 3 | 2019-01-24T07:48:15.000Z | 2021-06-11T13:34:44.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... | 44.053333 | 160 | 0.641344 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
connect_nodes,
disconnect_nodes,
sync_blocks,
)
class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
def skip_test_if_missing_module(sel... | true | true |
1c2e0ad3f936ed49b51ecbdc1a3f4c027568e304 | 34 | py | Python | services/users/app/api/utils/__init__.py | yuuta1999/microservice-with-flask | 6ad64341edb42c7f145aabc1e38e2619df75d444 | [
"MIT"
] | 1 | 2019-07-12T07:38:16.000Z | 2019-07-12T07:38:16.000Z | services/users/app/api/utils/__init__.py | yuuta1999/microservice-with-flask | 6ad64341edb42c7f145aabc1e38e2619df75d444 | [
"MIT"
] | 4 | 2021-03-09T09:19:49.000Z | 2022-02-26T12:14:12.000Z | services/users/app/api/utils/__init__.py | yuuta1999/microservice-with-flask | 6ad64341edb42c7f145aabc1e38e2619df75d444 | [
"MIT"
] | 1 | 2020-03-31T17:36:11.000Z | 2020-03-31T17:36:11.000Z | # users/app/api/utils/__init__.py
| 17 | 33 | 0.764706 | true | true | |
1c2e0b07893a87a3f953d0af53e08c131465a2dd | 25,200 | py | Python | AICamera/app/src/main/cpp/caffe2/python/layer_model_helper.py | blackxer/AICamera | 4f0a6a09a2288da2ec7140744b5c2862df114c78 | [
"MIT"
] | 1 | 2020-01-10T02:56:03.000Z | 2020-01-10T02:56:03.000Z | AICamera/app/src/main/cpp/caffe2/python/layer_model_helper.py | blackxer/AICamera | 4f0a6a09a2288da2ec7140744b5c2862df114c78 | [
"MIT"
] | null | null | null | AICamera/app/src/main/cpp/caffe2/python/layer_model_helper.py | blackxer/AICamera | 4f0a6a09a2288da2ec7140744b5c2862df114c78 | [
"MIT"
] | null | null | null | # @package layer_model_helper
# Module caffe2.python.layer_model_helper
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, model_helper, schema, scope, utils, muji
from caffe2.pytho... | 38.124054 | 88 | 0.598849 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, model_helper, schema, scope, utils, muji
from caffe2.python.modeling.parameter_info import (
ParameterInfo,
)
from caffe2.p... | true | true |
1c2e0b78f96a8e24dcf04517c311fe46e9e442c9 | 486 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | 1 | 2022-02-18T01:17:27.000Z | 2022-02-18T01:17:27.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | null | null | null | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.6 | 94 | 0.526749 |
VERSION = "2.2.1"
| true | true |
1c2e0bb59452ec4bfcecb5fd5e9c03320a4084ba | 1,267 | py | Python | anytask/groups/migrations/0001_initial.py | antselevich/anytask | b00ea8ad929f267ac4a37d1a0eaabce28c5b02cf | [
"MIT"
] | 31 | 2015-03-24T21:11:44.000Z | 2022-03-28T22:55:12.000Z | anytask/groups/migrations/0001_initial.py | antselevich/anytask | b00ea8ad929f267ac4a37d1a0eaabce28c5b02cf | [
"MIT"
] | 286 | 2015-06-11T10:32:16.000Z | 2022-03-28T12:01:04.000Z | anytask/groups/migrations/0001_initial.py | bcskda/anytask | 5a359dcb669b689fc5a4f1705f2c88cd031ab37d | [
"MIT"
] | 44 | 2015-05-23T21:30:51.000Z | 2021-11-07T12:56:59.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('years', '000... | 35.194444 | 114 | 0.604578 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('years', '0001_initial'),
]
... | true | true |
1c2e0e61dd9d9febbf9044acc472737cf3b71b63 | 2,004 | py | Python | combine_alignments_all3codons_distinguish_exons_nexuspartition.py | SethMusker/HybPiper_phasing_phyloscripts_modified | bfa9e38d48c6105d660383fa1ea60fcb3e1998a4 | [
"CC0-1.0"
] | null | null | null | combine_alignments_all3codons_distinguish_exons_nexuspartition.py | SethMusker/HybPiper_phasing_phyloscripts_modified | bfa9e38d48c6105d660383fa1ea60fcb3e1998a4 | [
"CC0-1.0"
] | null | null | null | combine_alignments_all3codons_distinguish_exons_nexuspartition.py | SethMusker/HybPiper_phasing_phyloscripts_modified | bfa9e38d48c6105d660383fa1ea60fcb3e1998a4 | [
"CC0-1.0"
] | null | null | null |
#Script to combine exon and intron alignments for a gene and generate a NEXUS formatted partition file.
# Seth's edit: specify all three codon positions as separate partitions (as recommended by PartitionFinder)
# also: write to 'exons_only.fasta/partition' if no intron file exists
# NB at present this script does not... | 35.785714 | 108 | 0.667665 |
# also: write to 'exons_only.fasta/partition' if no intron file exists
# NB at present this script does not work with python 3
import sys,os
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
if len(sys.argv) < 4:
print("Usage: python combine_alignments.py exon.fasta intron.fasta... | true | true |
1c2e0ec76ac723f9616df1e26e9f8568738a1846 | 3,049 | py | Python | docs/conf.py | ClaraCDouglas/CarbonUptakeInWG | b435f51ab64e472cced0277ad3b932e2a9c9414b | [
"MIT"
] | 2 | 2021-10-05T14:56:53.000Z | 2022-01-30T18:27:53.000Z | docs/conf.py | ClaraCDouglas/CarbonUptakeInWG | b435f51ab64e472cced0277ad3b932e2a9c9414b | [
"MIT"
] | 1 | 2021-07-14T10:34:29.000Z | 2021-07-14T10:34:29.000Z | docs/conf.py | ClaraCDouglas/CarbonUptakeInWG | b435f51ab64e472cced0277ad3b932e2a9c9414b | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.045977 | 79 | 0.679895 |
import os
import pathlib
import sys
print("python exec:", sys.executable)
print("sys.path:", sys.path)
root = pathlib.Path(__file__).parent.parent.absolute()
os.environ["PYTHONPATH"] = str(root)
sys.path.insert(0, str(root))
import carbonuptakeinwg
project = "carbonuptakeinwg"
copyright = "2021, Cla... | true | true |
1c2e0ed4c75c604321d2b67d71992aa45ce7be39 | 4,480 | py | Python | examples/python/matrix_from_duration_data.py | raphaelchaves/transitionMatrix | 6ac54c8c6ce15dc81aa5e894cfcfabb127634b33 | [
"Apache-2.0"
] | null | null | null | examples/python/matrix_from_duration_data.py | raphaelchaves/transitionMatrix | 6ac54c8c6ce15dc81aa5e894cfcfabb127634b33 | [
"Apache-2.0"
] | 2 | 2021-01-13T21:58:06.000Z | 2021-02-07T12:20:00.000Z | examples/python/matrix_from_duration_data.py | raphaelchaves/transitionMatrix | 6ac54c8c6ce15dc81aa5e894cfcfabb127634b33 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# (c) 2017-2020 Open Risk, all rights reserved
#
# TransitionMatrix is licensed under the Apache 2.0 license a copy of which is included
# in the source distribution of TransitionMatrix. This is notwithstanding any licenses of
# third-party software included in this distribution. You may not use this... | 41.481481 | 113 | 0.69933 |
import pandas as pd
import transitionMatrix as tm
from transitionMatrix import source_path
from transitionMatrix.estimators import cohort_estimator as es
dataset_path = source_path + "datasets/"
example = 3
if example == 1:
data = pd.read_csv(dataset_path + 'synthetic_data1.csv', dtyp... | true | true |
1c2e0f739c71c9793927448ad4aeba67410ef221 | 13,713 | py | Python | Train.py | karino2/Pytorch-Handwritten-Mathematical-Expression-Recognition | 6c6139624c71fa68a0a386a94346cfab39d0f087 | [
"MIT"
] | null | null | null | Train.py | karino2/Pytorch-Handwritten-Mathematical-Expression-Recognition | 6c6139624c71fa68a0a386a94346cfab39d0f087 | [
"MIT"
] | null | null | null | Train.py | karino2/Pytorch-Handwritten-Mathematical-Expression-Recognition | 6c6139624c71fa68a0a386a94346cfab39d0f087 | [
"MIT"
] | null | null | null | '''
Python 3.6
Pytorch 0.4
Written by Hongyu Wang in Beihang university
'''
import torch
import math
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy
import torch.utils.data as data
from data_iterator import dataIterator
from Densenet_torchvision import densenet121... | 37.263587 | 125 | 0.600379 | import torch
import math
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy
import torch.utils.data as data
from data_iterator import dataIterator
from Densenet_torchvision import densenet121
from Attention_RNN import AttnDecoderRNN
import random
def cmp_result(labe... | true | true |
1c2e1066fb3d5b44d2588a5b81741d29c458ba76 | 2,496 | py | Python | kratos_salome_plugin/gui/project_path_handler.py | armingeiser/KratosSalomePlugin | d402ca9edef8dff071ceabf0ebac0d858a6fbfcc | [
"BSD-3-Clause"
] | 6 | 2020-01-23T20:54:17.000Z | 2021-02-19T09:52:29.000Z | kratos_salome_plugin/gui/project_path_handler.py | armingeiser/KratosSalomePlugin | d402ca9edef8dff071ceabf0ebac0d858a6fbfcc | [
"BSD-3-Clause"
] | 20 | 2020-01-25T16:05:43.000Z | 2020-12-18T20:36:46.000Z | kratos_salome_plugin/gui/project_path_handler.py | armingeiser/KratosSalomePlugin | d402ca9edef8dff071ceabf0ebac0d858a6fbfcc | [
"BSD-3-Clause"
] | 3 | 2020-05-27T13:31:08.000Z | 2020-12-18T19:50:43.000Z | # _ __ _ ___ _ ___ _ _
# | |/ /_ _ __ _| |_ ___ __/ __| __ _| |___ _ __ ___| _ \ |_ _ __ _(_)_ _
# | ' <| '_/ _` | _/ _ (_-<__ \/ _` | / _ \ ' \/ -_) _/ | || / _` | | ' \
# |_|\_\_| \__,_|\__\___/__/___/\__,_|_\___/_|_|_\___|_| |_|\_,_\__, |_|_||_|
# ... | 29.364706 | 107 | 0.584936 |
from pathlib import Path
import logging
logger = logging.getLogger(__name__)
from PyQt5.QtWidgets import QFileDialog
from kratos_salome_plugin.exceptions import UserInputError
class ProjectPathHandler:
def __init__(self):
self.last_path = Path.home()
def GetOpenPath(self, par... | true | true |
1c2e107c782982208a14f5963f086828266d73c3 | 1,277 | py | Python | src/pre_process/ReadData.py | joaorura/k-NN_Iris_Classificator | e7d6eab400911587e4ced89fe4bb1b194e60527b | [
"MIT"
] | null | null | null | src/pre_process/ReadData.py | joaorura/k-NN_Iris_Classificator | e7d6eab400911587e4ced89fe4bb1b194e60527b | [
"MIT"
] | null | null | null | src/pre_process/ReadData.py | joaorura/k-NN_Iris_Classificator | e7d6eab400911587e4ced89fe4bb1b194e60527b | [
"MIT"
] | null | null | null | import csv
from copy import deepcopy
from utils.check_functions import check_type
class ReadData:
def _check_values(self):
check_type(self._path, str, "O campo path deve ser uma string que contem o caminho para o csv com os dados.")
def _execute(self):
with open(self._path) as file:
... | 27.76087 | 117 | 0.552858 | import csv
from copy import deepcopy
from utils.check_functions import check_type
class ReadData:
def _check_values(self):
check_type(self._path, str, "O campo path deve ser uma string que contem o caminho para o csv com os dados.")
def _execute(self):
with open(self._path) as file:
... | true | true |
1c2e107c86e64abef11fe9830e61fc754660ecb1 | 16,139 | py | Python | django_mfa/views.py | juwaini/django-mfa | 910b0f544ae5bebc02434cc6b176f74b5040f3b7 | [
"MIT"
] | null | null | null | django_mfa/views.py | juwaini/django-mfa | 910b0f544ae5bebc02434cc6b176f74b5040f3b7 | [
"MIT"
] | null | null | null | django_mfa/views.py | juwaini/django-mfa | 910b0f544ae5bebc02434cc6b176f74b5040f3b7 | [
"MIT"
] | null | null | null | import base64
import codecs
import random
import hashlib
import re
import string
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, resolve_url, get_object_or_404
from django... | 37.707944 | 195 | 0.656546 | import base64
import codecs
import random
import hashlib
import re
import string
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, resolve_url, get_object_or_404
from django... | true | true |
1c2e117b00b2db71fc25635adafe1b717fcbdc66 | 664 | py | Python | mod/data_process/__init__.py | Ulti-Dreisteine/data-information-measurement | 9ef777c28534867d07d9ab1a1b95d69a385043f1 | [
"MIT"
] | 1 | 2021-12-17T13:51:11.000Z | 2021-12-17T13:51:11.000Z | mod/data_process/__init__.py | Ulti-Dreisteine/data-information-measurement | 9ef777c28534867d07d9ab1a1b95d69a385043f1 | [
"MIT"
] | null | null | null | mod/data_process/__init__.py | Ulti-Dreisteine/data-information-measurement | 9ef777c28534867d07d9ab1a1b95d69a385043f1 | [
"MIT"
] | 1 | 2021-12-12T12:38:36.000Z | 2021-12-12T12:38:36.000Z | # -*- coding: utf-8 -*-
"""
Created on 2021/02/27 17:03:09
@File -> __init__.py
@Author: luolei
@Email: dreisteine262@163.com
@Describe: 初始化
"""
__all__ = ['search_nearest_neighbors_in_list']
import bisect
def search_nearest_neighbors_in_list(lst, x):
"""
寻找x在有序lst中的两侧(或单侧)邻点值.
:param x: float
:param lst: l... | 17.945946 | 58 | 0.661145 |
__all__ = ['search_nearest_neighbors_in_list']
import bisect
def search_nearest_neighbors_in_list(lst, x):
if x in lst:
return [x]
else:
if x <= lst[0]:
neighbors = [lst[0]]
elif x >= lst[-1]:
neighbors = [lst[-1]]
else:
left_idx = bisect.bisect_left(lst, x) - 1
right_idx = left_idx + 1
ne... | true | true |
1c2e117e88b789fbb76ce2554bd03d63b693cd11 | 6,681 | py | Python | scripts/split_fasta.py | 861934367/cgat | 77fdc2f819320110ed56b5b61968468f73dfc5cb | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | scripts/split_fasta.py | 861934367/cgat | 77fdc2f819320110ed56b5b61968468f73dfc5cb | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | scripts/split_fasta.py | 861934367/cgat | 77fdc2f819320110ed56b5b61968468f73dfc5cb | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-08-04T22:46:38.000Z | 2019-08-04T22:46:38.000Z | '''
split_fasta.py -
======================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
.. todo::
describe purpose of the script.
Usage
-----
Example::
python split_fasta.py --help
Type::
python split_fasta.py --help
for comma... | 26.61753 | 95 | 0.57656 | '''
split_fasta.py -
======================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
.. todo::
describe purpose of the script.
Usage
-----
Example::
python split_fasta.py --help
Type::
python split_fasta.py --help
for comma... | false | true |
1c2e1363d0cbbeedc29abaa18b06b0b3d68bc7b4 | 2,231 | py | Python | carla_utils/agents/vehicle_model.py | IamWangYunKai/DG-TrajGen | 0a8aab7e1c05111a5afe43d53801c55942e9ff56 | [
"MIT"
] | 31 | 2021-09-15T00:43:43.000Z | 2022-03-27T22:57:21.000Z | carla_utils/agents/vehicle_model.py | zhangdongkun98/carla-utils | a370db53589841c8cffe95c8df43dfc036176431 | [
"MIT"
] | 1 | 2021-12-09T03:08:13.000Z | 2021-12-15T07:08:31.000Z | carla_utils/agents/vehicle_model.py | zhangdongkun98/carla-utils | a370db53589841c8cffe95c8df43dfc036176431 | [
"MIT"
] | 2 | 2021-11-26T05:45:18.000Z | 2022-01-19T12:46:41.000Z |
import numpy as np
import torch
import torch.nn as nn
from ..basic import pi2pi_numpy, pi2pi_tensor
from ..augment import State
class RealModel(object):
def __call__(self, *args, **kwargs):
return self.forward(*args, **kwargs)
def forward(self, vehicle, control):
vehicle.apply_control(contr... | 28.602564 | 93 | 0.549978 |
import numpy as np
import torch
import torch.nn as nn
from ..basic import pi2pi_numpy, pi2pi_tensor
from ..augment import State
class RealModel(object):
def __call__(self, *args, **kwargs):
return self.forward(*args, **kwargs)
def forward(self, vehicle, control):
vehicle.apply_control(contr... | true | true |
1c2e139b9074398a0d52513986701c7d155a28ec | 10 | py | Python | test/orm/__init__.py | vollov/py-lab | 0a1a3c93c5decaa5246fab981bcc2563cc42c6d0 | [
"MIT"
] | null | null | null | test/orm/__init__.py | vollov/py-lab | 0a1a3c93c5decaa5246fab981bcc2563cc42c6d0 | [
"MIT"
] | null | null | null | test/orm/__init__.py | vollov/py-lab | 0a1a3c93c5decaa5246fab981bcc2563cc42c6d0 | [
"MIT"
] | null | null | null | import orm | 10 | 10 | 0.9 | import orm | true | true |
1c2e14776c2596c0ba1de38b0ccc53066ea2ca9a | 431 | py | Python | python/testData/hierarchy/call/Static/Constructor/main.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/hierarchy/call/Static/Constructor/main.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/hierarchy/call/Static/Constructor/main.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class A():
def __init__(self):
invoke1(self)
invoke2(self)
def method1(self):
pass
def method2(self):
pass
def invoke1(p):
p.method1()
def invoke2(p):
p.method2()
def invokeA():
a = A()
a.method1()
a.method2()
def new_class_func():
clas... | 13.46875 | 28 | 0.487239 | class A():
def __init__(self):
invoke1(self)
invoke2(self)
def method1(self):
pass
def method2(self):
pass
def invoke1(p):
p.method1()
def invoke2(p):
p.method2()
def invokeA():
a = A()
a.method1()
a.method2()
def new_class_func():
clas... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.