hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72af6a3f7871c38684b0e461069b71876226a9b | 157 | py | Python | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Second'] , ['MLP'] ); | 39.25 | 84 | 0.751592 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Second'] , ['MLP'] ); | true | true |
f72af6e888f158710810a4b5ed837ab592f4f7f4 | 3,251 | py | Python | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 6 | 2020-07-09T20:55:41.000Z | 2022-01-22T15:43:29.000Z | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 1 | 2021-02-28T13:37:43.000Z | 2021-02-28T13:37:43.000Z | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 5 | 2020-05-24T19:15:06.000Z | 2022-01-22T15:43:35.000Z | """Utilities for making unittests easier to write."""
# pylint: disable=protected-access
import asyncio
import os
import queue
from typing import Dict, List, Optional, Union
from ibapi import wrapper
from ibpy_native import error
from ibpy_native import models
from ibpy_native.interfaces import delegates
from ibpy_na... | 30.669811 | 77 | 0.671486 |
import asyncio
import os
import queue
from typing import Dict, List, Optional, Union
from ibapi import wrapper
from ibpy_native import error
from ibpy_native import models
from ibpy_native.interfaces import delegates
from ibpy_native.interfaces import listeners
from ibpy_native.utils import finishable_queue as fq
... | true | true |
f72af7d6e7b04db16a0baa10f553c130371e0a1e | 1,561 | py | Python | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python3
# date: 2019.08.06
# https://stackoverflow.com/questions/57366488/how-to-pass-the-single-link-in-a-nested-url-scrape
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose
def clean(text):
text = text.replace('\xa0', ' ')
text = text.strip().... | 31.22 | 118 | 0.643177 |
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose
def clean(text):
text = text.replace('\xa0', ' ')
text = text.strip().split('\n')
text = ' '.join(x.strip() for x in text)
return text
class ComicscraperItem(scrapy.Item):
title = scrapy.Field(i... | true | true |
f72af7e4a722a6457a4e5bb9862634b05fb4b74c | 3,915 | py | Python | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | 1 | 2019-10-11T17:15:20.000Z | 2019-10-11T17:15:20.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 34.043478 | 108 | 0.61507 |
import pprint
import re
import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class Altitude(object):
deserialized_types = {
'altitude_in_meters': 'float',
'accuracy_in_meters'... | true | true |
f72af7f234a3a7aaf0e57fc752f62d4dd0d648af | 38 | py | Python | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | def new_user(user_stringvar):
pass | 19 | 29 | 0.763158 | def new_user(user_stringvar):
pass | true | true |
f72af8f3d31d026bd4517c8b3a0509701311dff5 | 4,016 | py | Python | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | # Export Nexus device show interface brief command output to
# an Excel file
import json
import xlsxwriter
from netmiko import ConnectHandler
# Devices to SSH into
devices = [
{
"device_type": "cisco_nxos",
"ip": "sbx-nxos-mgmt.cisco.com",
"username": "admin",
"password": "Admin_1... | 34.033898 | 93 | 0.528884 |
import json
import xlsxwriter
from netmiko import ConnectHandler
devices = [
{
"device_type": "cisco_nxos",
"ip": "sbx-nxos-mgmt.cisco.com",
"username": "admin",
"password": "Admin_1234!",
"port": 8181,
"fast_cli": False,
"session_log": "nxos-exercise4.l... | true | true |
f72af970ed2aadceab74dc301a14ce7e5a191b93 | 2,414 | py | Python | examples/adspygoogle/dfp/v201101/delete_custom_targeting_keys.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201101/delete_custom_targeting_keys.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | examples/adspygoogle/dfp/v201101/delete_custom_targeting_keys.py | hockeyprincess/google-api-dfp-python | efa82a8d85cbdc90f030db9d168790c55bd8b12a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 34.485714 | 80 | 0.718724 |
"""This example deletes a custom targeting key by its name. To determine which
custom targeting keys exist, run get_all_custom_targeting_keys_and_values.py."""
__author__ = 'api.sgrinberg@gmail.com (Stan Grinberg)'
import os
import sys
sys.path.append(os.path.join('..', '..', '..', '..'))
from ads... | false | true |
f72afbb1ae862f6cc33248e2ecf5c95000d6017c | 7,390 | py | Python | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | null | null | null | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | 82 | 2020-08-06T17:11:12.000Z | 2021-02-07T21:01:05.000Z | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | 2 | 2020-10-16T22:03:24.000Z | 2020-11-15T22:45:19.000Z | """
Format a DataSetInfo for use in a JSON Release
"""
import json
from opendp_apps.dataset.models import DataSetInfo
from opendp_apps.dataset import static_vals as dstatic
from opendp_apps.model_helpers.basic_err_check import BasicErrCheck
from opendp_apps.model_helpers.basic_response import ok_resp, err_resp, BasicRe... | 34.858491 | 102 | 0.604195 | import json
from opendp_apps.dataset.models import DataSetInfo
from opendp_apps.dataset import static_vals as dstatic
from opendp_apps.model_helpers.basic_err_check import BasicErrCheck
from opendp_apps.model_helpers.basic_response import ok_resp, err_resp, BasicResponse
class DataSetFormatter(BasicErrCheck):
... | true | true |
f72afc6fd07bcfad6b0ce2194a5a5dfd54a13f25 | 9,191 | py | Python | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 248 | 2019-01-10T21:58:46.000Z | 2022-03-30T07:55:34.000Z | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 17 | 2018-10-09T19:17:25.000Z | 2022-02-27T07:33:11.000Z | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 66 | 2019-06-08T12:18:43.000Z | 2022-03-29T07:44:18.000Z | import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... | 37.060484 | 158 | 0.586878 | import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... | true | true |
f72afd17d996c315fc23e466eee5e411f1188c6d | 5,980 | py | Python | duoSpider.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | duoSpider.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | duoSpider.py | susemm/books | 80e96dd0ef7309707b37b036c991d4b11a9bed0a | [
"Apache-2.0"
] | null | null | null | __author__ = 'vin@misday.com'
import sys, re, os, wx
from datetime import *
from urlparse import urlparse
from bs4 import BeautifulSoup
from pyvin.spider import Spider
from pyvin.core import Callbacks
reload(sys)
sys.setdefaultencoding('utf8')
class Special(Callbacks):
siteRoot = 'http://www.duokan.com'
(... | 40.958904 | 111 | 0.527926 | __author__ = 'vin@misday.com'
import sys, re, os, wx
from datetime import *
from urlparse import urlparse
from bs4 import BeautifulSoup
from pyvin.spider import Spider
from pyvin.core import Callbacks
reload(sys)
sys.setdefaultencoding('utf8')
class Special(Callbacks):
siteRoot = 'http://www.duokan.com'
(... | false | true |
f72afdb37d0bc3631c2708300be0110723f46ee0 | 4,090 | py | Python | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | 1 | 2021-09-02T21:06:31.000Z | 2021-09-02T21:06:31.000Z | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import urllib
from pants.java.distribution.distribution import DistributionLocator
from pants.subsystem.subsystem import Subsystem
class IvySubsystem(Subsystem):
"""Common c... | 37.181818 | 97 | 0.674817 |
import os
import urllib
from pants.java.distribution.distribution import DistributionLocator
from pants.subsystem.subsystem import Subsystem
class IvySubsystem(Subsystem):
options_scope = 'ivy'
_DEFAULT_VERSION = '2.4.0'
_DEFAULT_URL = ('https://repo1.maven.org/maven2/'
'org/apache/ivy/iv... | true | true |
f72afdfc03221196ea9ceaf1098c9e1569cc1366 | 808 | py | Python | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | from pathlib import Path
import nltk
from nltk.tokenize import sent_tokenize
tokenizer = nltk.RegexpTokenizer(r"([A-Z][A-Z0-9.]+|[0-9]+[,.][0-9]+|[cdjlmnst]'|qu'|[\w'-]+|\S)")
class Sentence:
def __init__(self, text, nth):
self.text = text
self.nth = nth
def __len__(self):
return le... | 22.444444 | 98 | 0.62005 | from pathlib import Path
import nltk
from nltk.tokenize import sent_tokenize
tokenizer = nltk.RegexpTokenizer(r"([A-Z][A-Z0-9.]+|[0-9]+[,.][0-9]+|[cdjlmnst]'|qu'|[\w'-]+|\S)")
class Sentence:
def __init__(self, text, nth):
self.text = text
self.nth = nth
def __len__(self):
return le... | true | true |
f72afeec1ac6435e1b1eedcbe12ee9db89f07d10 | 8,129 | py | Python | TDETestCases.py | GGSimmons1992/timeDelayEstimation | 007a04cbf02ef168d9ebfd4ac72fbbed1dc7cb2a | [
"MIT"
] | 3 | 2019-03-01T00:16:01.000Z | 2021-12-15T00:00:48.000Z | TDETestCases.py | GGSimmons1992/timeDelayEstimation | 007a04cbf02ef168d9ebfd4ac72fbbed1dc7cb2a | [
"MIT"
] | null | null | null | TDETestCases.py | GGSimmons1992/timeDelayEstimation | 007a04cbf02ef168d9ebfd4ac72fbbed1dc7cb2a | [
"MIT"
] | 2 | 2021-12-03T11:49:32.000Z | 2021-12-15T00:11:29.000Z | """
Compilation of functions used to make test cases
"""
import numpy as np
import random
pi=np.pi
Debugger=0
def PlaneWavePacket(Amp,k,omega,theta,sigma,x,y,SNR,length):
Vx=(omega/k)*np.cos(theta)
Vy=(omega/k)*np.sin(theta)
kx=k*np.cos(theta)
ky=k*np.sin(theta)
t=np.arange(length)-int(length/2)
... | 36.452915 | 115 | 0.598352 | """
Compilation of functions used to make test cases
"""
import numpy as np
import random
pi=np.pi
Debugger=0
def PlaneWavePacket(Amp,k,omega,theta,sigma,x,y,SNR,length):
Vx=(omega/k)*np.cos(theta)
Vy=(omega/k)*np.sin(theta)
kx=k*np.cos(theta)
ky=k*np.sin(theta)
t=np.arange(length)-int(length/2)
... | false | true |
f72aff11df732c260aca806b126e282388a93204 | 4,897 | py | Python | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 2 | 2017-06-21T09:46:55.000Z | 2018-05-30T10:07:32.000Z | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | null | null | null | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 1 | 2020-10-01T04:11:41.000Z | 2020-10-01T04:11:41.000Z | import datetime
import logging
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import APIException
import seaserv
from seahub.base.accounts import User
from seahub.constants import GUEST_USER
from seahub.api2.models import Token, TokenV2
fro... | 33.772414 | 95 | 0.647131 | import datetime
import logging
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import APIException
import seaserv
from seahub.base.accounts import User
from seahub.constants import GUEST_USER
from seahub.api2.models import Token, TokenV2
fro... | true | true |
f72affbaf63edad2e1efdfe81604b7c4734c0339 | 405 | py | Python | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | from distutils.core import setup
DESC='A simple, extensible chatbot for Matrix'
setup(
name='python-matrix-gfyrslf',
version='0.1',
author='Matt Stroud',
author_email='see github',
url='https://github.com/mstroud/python-matrix-gfyrslf',
packages=['python-matrix-gfyrslf'],
install_requires=... | 23.823529 | 59 | 0.688889 | from distutils.core import setup
DESC='A simple, extensible chatbot for Matrix'
setup(
name='python-matrix-gfyrslf',
version='0.1',
author='Matt Stroud',
author_email='see github',
url='https://github.com/mstroud/python-matrix-gfyrslf',
packages=['python-matrix-gfyrslf'],
install_requires=... | true | true |
f72b00a5286e87e05ac8c588aa0072278e0c0565 | 30 | py | Python | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | from .bot import WorkerRushBot | 30 | 30 | 0.866667 | from .bot import WorkerRushBot | true | true |
f72b00c52fc98e9202a373c7817029e4bb84f7b4 | 8,185 | py | Python | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | null | null | null | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | 6 | 2020-11-23T14:38:55.000Z | 2021-01-10T16:55:57.000Z | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | null | null | null | from fastapi import FastAPI, Depends, Form
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from starlette.templating import Jinja2Templates
from starlette.requests import Request
from starlette.responses import RedirectResponse
from datetime import datetime, timedelta
import db
import hashlib
from mycalen... | 32.871486 | 94 | 0.579475 | from fastapi import FastAPI, Depends, Form
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from starlette.templating import Jinja2Templates
from starlette.requests import Request
from starlette.responses import RedirectResponse
from datetime import datetime, timedelta
import db
import hashlib
from mycalen... | true | true |
f72b00ff538cfdf542ff5ed70d45d7fe2e7d661e | 2,499 | py | Python | bin/old/findUnannotated.py | PapenfussLab/Srtools | 6dff62cd8d1615d4f7d4e5b8a0de9ba8eebab90e | [
"Artistic-2.0"
] | null | null | null | bin/old/findUnannotated.py | PapenfussLab/Srtools | 6dff62cd8d1615d4f7d4e5b8a0de9ba8eebab90e | [
"Artistic-2.0"
] | null | null | null | bin/old/findUnannotated.py | PapenfussLab/Srtools | 6dff62cd8d1615d4f7d4e5b8a0de9ba8eebab90e | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python
"""
findUnannotated.py
Author: Tony Papenfuss
Date: Fri Aug 15 12:19:24 EST 2008
"""
import os, sys
from bx.intervals.intersection import *
from fasta import FastaFile
from blast import BlastFile
from useful import progressMessage
print "Load Solexa contigs & store as Intervals in an Interse... | 27.163043 | 92 | 0.648259 |
"""
findUnannotated.py
Author: Tony Papenfuss
Date: Fri Aug 15 12:19:24 EST 2008
"""
import os, sys
from bx.intervals.intersection import *
from fasta import FastaFile
from blast import BlastFile
from useful import progressMessage
print "Load Solexa contigs & store as Intervals in an Intersecter object"
contigDa... | false | true |
f72b01644b9c24e4ff1dde34645ffd6b1aec9355 | 2,765 | py | Python | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | #
# Copyright (c) 2009, Novartis Institutes for BioMedical Research Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyri... | 37.364865 | 86 | 0.707052 |
from rdkit.ML.Cluster import Butina
from rdkit import DataStructs
import sys, pickle
sims = [.9, .8, .7, .6]
smis = []
uniq = []
uFps = []
for fileN in sys.argv[1:]:
inF = file(sys.argv[1], 'r')
cols = pickle.load(inF)
fps = pickle.load(inF)
for row in fps:
nm, smi, fp = ... | true | true |
f72b01a7f0fb8665343e290a8c45dfabc5c03f99 | 801 | py | Python | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | 2 | 2020-10-23T08:58:18.000Z | 2021-05-03T17:30:03.000Z | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | null | null | null | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | 1 | 2020-10-23T09:07:19.000Z | 2020-10-23T09:07:19.000Z | import numpy as np
def compute_anomaly_corrs(out_true, out_pred):
anomaly_corrs = np.zeros(out_pred.shape[1])
for i in range(anomaly_corrs.size):
anomaly_corrs[i] = np.corrcoef(out_pred[:,i], out_true[:,i])[0,1]
return anomaly_corrs
def split_train_data(train_months, test_months, tra... | 36.409091 | 80 | 0.740325 | import numpy as np
def compute_anomaly_corrs(out_true, out_pred):
anomaly_corrs = np.zeros(out_pred.shape[1])
for i in range(anomaly_corrs.size):
anomaly_corrs[i] = np.corrcoef(out_pred[:,i], out_true[:,i])[0,1]
return anomaly_corrs
def split_train_data(train_months, test_months, tra... | true | true |
f72b01c050db440e10771a348c74c4d89b91660f | 19,971 | py | Python | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 176 | 2015-01-02T13:55:39.000Z | 2022-03-12T11:44:37.000Z | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 495 | 2015-01-13T06:47:06.000Z | 2022-03-12T11:07:03.000Z | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 62 | 2015-02-23T08:19:38.000Z | 2022-03-18T06:01:22.000Z | # -*- coding: utf-8 -*-
"""Gzip compressed stream file."""
# Note: do not rename file to gzip.py this can cause the exception:
# AttributeError: 'module' object has no attribute 'GzipFile'
# when using pip.
import collections
import os
from dtfabric.runtime import fabric as dtfabric_fabric
from dfvfs.compression im... | 33.452261 | 80 | 0.714286 |
import collections
import os
from dtfabric.runtime import fabric as dtfabric_fabric
from dfvfs.compression import zlib_decompressor
from dfvfs.lib import data_format
from dfvfs.lib import errors
class _GzipDecompressorState(object):
_MAXIMUM_READ_SIZE = 16 * 1024 * 1024
def __init__(self, stream_start):... | true | true |
f72b027333bbe2d8bc09150e018d4e2a3f9db7df | 11,472 | py | Python | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | 29.720207 | 369 | 0.602772 |
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from .fetchers import NUEventLogsFetcher
from bambou import NURESTObject
class NUStaticRoute(NURESTObject):
__rest_name__ = "staticroute"
__resource_name__ = "staticroutes"
ONS... | true | true |
f72b045654dc44f3155f6d877133a3202b759449 | 5,054 | py | Python | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | null | null | null | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | 2 | 2021-09-29T15:08:25.000Z | 2022-01-13T11:20:58.000Z | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | 1 | 2021-09-10T12:25:08.000Z | 2021-09-10T12:25:08.000Z | # -*- coding: utf-8 -*-
import numpy as np
from graphviz import Source
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from dku_error_analysis_mpp.dku_error_analyzer import DkuErrorAnalyzer
from mealy import _BaseErrorVisualizer, ErrorAnalyzerConstants
from dku_error_analysis_utils import safe_s... | 49.54902 | 149 | 0.609616 |
import numpy as np
from graphviz import Source
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from dku_error_analysis_mpp.dku_error_analyzer import DkuErrorAnalyzer
from mealy import _BaseErrorVisualizer, ErrorAnalyzerConstants
from dku_error_analysis_utils import safe_str, format_float
impor... | true | true |
f72b0480495825ee249d8a39b4e17d79b9ad98f0 | 1,812 | py | Python | scan_meta.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | scan_meta.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | scan_meta.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import base64
import httplib
import json
from config import *
from base.log import *
import happybase
from base.timer import Timer
from base import util
__thrift_host = GET_CONF('hbase_thrift', 'host')
__thrift_port = int(GET_CONF('hbase_thrift', 'port'))
thrift_conn = None... | 24.16 | 89 | 0.712472 |
import base64
import httplib
import json
from config import *
from base.log import *
import happybase
from base.timer import Timer
from base import util
__thrift_host = GET_CONF('hbase_thrift', 'host')
__thrift_port = int(GET_CONF('hbase_thrift', 'port'))
thrift_conn = None
def get_thrift_conn():
global thrift_... | false | true |
f72b04ab534d3991395505fbd9524526beed8f88 | 5,288 | py | Python | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | null | null | null | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | 6 | 2019-12-13T09:55:45.000Z | 2022-03-11T23:47:29.000Z | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | 1 | 2019-05-16T06:58:16.000Z | 2019-05-16T06:58:16.000Z | # Copyright (c) 2012-2016 Seafile Ltd.
import posixpath
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.utils.trans... | 34.562092 | 106 | 0.587368 |
import posixpath
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.utils.translation import ugettext as _
from seas... | true | true |
f72b04c22d26af35d88e3f843c7d2b7c9e606c26 | 120 | py | Python | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | print("Hello, Python!")
print("Zoltan")
#print(Zoltan)
#print "Zoltan"
print('Zoltan')
print('''
Alma
on the
tree
'''
)
| 10 | 23 | 0.65 | print("Hello, Python!")
print("Zoltan")
print('Zoltan')
print('''
Alma
on the
tree
'''
)
| true | true |
f72b058123386b2f12effdfae7010abf516ca956 | 13,314 | py | Python | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is derived from a
version of the externally m... | 39.981982 | 81 | 0.653372 | __version__ = '2.0.9'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
]
__author__ = 'Bob Ippolito <bob@redivi.com>'
from .decoder import JSONDecoder, JSONDecodeError
from .encoder import JSONEncoder
_default_encoder = JSONEncoder(
skipkeys=False,
ensure... | true | true |
f72b05a1e16676d1178d4682bdc7c44175562994 | 3,192 | py | Python | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | import requests, json, os
import argparse
import pandas as pd
import ijson
import time
# Elasticsearch python libs
from elasticsearch import Elasticsearch
from elasticsearch import helpers
directory = ""
indexName = "aurora-meta2"
typeName = "patient"
THRESHOLD = 10000 # this regulates how much data gets loaded the... | 25.95122 | 109 | 0.628446 | import requests, json, os
import argparse
import pandas as pd
import ijson
import time
from elasticsearch import Elasticsearch
from elasticsearch import helpers
directory = ""
indexName = "aurora-meta2"
typeName = "patient"
THRESHOLD = 10000
PK = "ID"
json_root = "item"
errors = []
def loadit():
es = Elasticsea... | true | true |
f72b05a397836379cf15a5545dc470a6f2762a91 | 5,781 | py | Python | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | 2 | 2022-03-08T02:54:57.000Z | 2022-03-10T09:09:40.000Z | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | null | null | null | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | null | null | null | import logging
import copy
import bisect
import numpy as np
import torch.utils.data
from smoke.utils.comm import get_world_size
from smoke.utils.imports import import_file
from smoke.utils.envs import seed_all_rng
from . import datasets as D
from . import samplers
from .transforms import build_transforms
from .colla... | 34.825301 | 145 | 0.669088 | import logging
import copy
import bisect
import numpy as np
import torch.utils.data
from smoke.utils.comm import get_world_size
from smoke.utils.imports import import_file
from smoke.utils.envs import seed_all_rng
from . import datasets as D
from . import samplers
from .transforms import build_transforms
from .colla... | true | true |
f72b0684f170d3fddc3fc47d05fff76101d188b3 | 1,072 | py | Python | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | import argparse
def add_common_args(parser: argparse.ArgumentParser):
parser.add_argument(
'--dry-run',
action='store_true',
default=False,
help='If true, will not actually do any changes to i3 workspaces.')
parser.add_argument(
'--log-level',
choices=('debug', ... | 34.580645 | 78 | 0.636194 | import argparse
def add_common_args(parser: argparse.ArgumentParser):
parser.add_argument(
'--dry-run',
action='store_true',
default=False,
help='If true, will not actually do any changes to i3 workspaces.')
parser.add_argument(
'--log-level',
choices=('debug', ... | true | true |
f72b073f2c249ce06aea52ce2b03bad057fb64ac | 10,626 | py | Python | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | import jpype
import jpype.imports
from jpype.types import *
from neqsim.neqsimpython import neqsim
processoperations = neqsim.processSimulation.processSystem.ProcessSystem()
def stream(thermoSystem, name="stream ?", t=0, p=0):
if t != 0:
thermoSystem.setTemperature(t)
if p != 0:
thermo... | 36.768166 | 159 | 0.769245 | import jpype
import jpype.imports
from jpype.types import *
from neqsim.neqsimpython import neqsim
processoperations = neqsim.processSimulation.processSystem.ProcessSystem()
def stream(thermoSystem, name="stream ?", t=0, p=0):
if t != 0:
thermoSystem.setTemperature(t)
if p != 0:
thermo... | true | true |
f72b0759efafb83d0661f521221014ba2f8d3aab | 7,021 | py | Python | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 1 | 2021-11-29T23:15:07.000Z | 2021-11-29T23:15:07.000Z | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 40 | 2020-08-31T06:09:06.000Z | 2022-03-18T19:02:34.000Z | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"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 th... | 32.808411 | 79 | 0.565874 |
import unittest
import numpy
import retworkx
class TestFloydWarshall(unittest.TestCase):
parallel_threshold = 300
def test_vs_dijkstra_all_pairs(self):
graph = retworkx.PyGraph()
a = graph.add_node("A")
b = graph.add_node("B")
c = graph.add_node("C")
d = ... | true | true |
f72b08276373a7b8064dc7eb363bb32779d3d0ce | 9,830 | py | Python | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 101 | 2015-02-08T22:20:11.000Z | 2022-03-21T18:56:42.000Z | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 23 | 2016-11-30T08:33:21.000Z | 2021-01-26T12:11:12.000Z | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 27 | 2015-01-03T06:49:45.000Z | 2021-12-28T03:30:54.000Z | # -*- coding: utf-8 -*-
from anima.ui.lib import QtCore, QtWidgets
class TaskDashboardWidget(QtWidgets.QWidget):
"""A widget that displays task related information
"""
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskDashboa... | 35.487365 | 87 | 0.649135 |
from anima.ui.lib import QtCore, QtWidgets
class TaskDashboardWidget(QtWidgets.QWidget):
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskDashboardWidget, self).__init__(parent=parent)
self.vertical_layout = None
... | true | true |
f72b08b59e5cb86bba78fc94a90a6d1fa03c18e3 | 6,363 | py | Python | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | 3 | 2019-09-20T19:10:50.000Z | 2021-12-30T02:55:21.000Z | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | null | null | null | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | 1 | 2020-08-01T21:28:12.000Z | 2020-08-01T21:28:12.000Z | import numpy as np
import torch
import matplotlib.pyplot as plt
import os
import math
import scipy.stats as stats
import lsdr.envs.environment_sampler as env_sampler
from enum import IntEnum
############################
# Optimization Loss Opt
############################
class Objectives(IntEnum):
REWARDS = 1
... | 28.28 | 78 | 0.573157 | import numpy as np
import torch
import matplotlib.pyplot as plt
import os
import math
import scipy.stats as stats
import lsdr.envs.environment_sampler as env_sampler
from enum import IntEnum
objective_opt)
| true | true |
f72b09030b2c9ba7bc22260ba632e1a45e870da9 | 1,020 | py | Python | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | 6 | 2020-09-27T00:14:48.000Z | 2021-11-23T03:35:09.000Z | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | null | null | null | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | 2 | 2020-09-27T17:40:33.000Z | 2021-12-13T02:31:49.000Z | # -*- coding: utf-8 -*-
"""Pitz Daily
This case uses the pitzDaily example from the OpenFOAM tutorials
and varies two parameters: Reynolds number and height of the inlet.
It returns the pressure difference between inlet and outlet.
"""
import numpy as np
from active_learning_cfd.cfd_case import CFDCase
import os
... | 28.333333 | 77 | 0.683333 |
import numpy as np
from active_learning_cfd.cfd_case import CFDCase
import os
class PitzDaily(CFDCase):
mesher = "blockMesh"
solver = "simpleFoam"
template = "pitzDaily"
parameter_names = ("reynolds", "entryHeight")
output_list = (("deltaP", "subtract\(p\) = (.+)"),)
def __call__(self, par... | true | true |
f72b091c4068f3540061214d903965fad918e1a4 | 5,557 | py | Python | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | 6 | 2020-07-09T02:48:41.000Z | 2021-06-16T09:04:14.000Z | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | null | null | null | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | 1 | 2020-05-19T11:45:45.000Z | 2020-05-19T11:45:45.000Z | import torch
from torch import nn
from torch.nn import CrossEntropyLoss
import logging
from .bert_model import BertPreTrainedModel, BertPreTrainingHeads, BertModel, BertEncoder, BertPooler, BertLayerNorm
logger = logging.getLogger(__name__)
class DualPositionBertEmbeddings(nn.Module):
"""Construct the embedding... | 41.781955 | 119 | 0.703617 | import torch
from torch import nn
from torch.nn import CrossEntropyLoss
import logging
from .bert_model import BertPreTrainedModel, BertPreTrainingHeads, BertModel, BertEncoder, BertPooler, BertLayerNorm
logger = logging.getLogger(__name__)
class DualPositionBertEmbeddings(nn.Module):
def __init__(self, config... | true | true |
f72b094590d5184ffbaf3cd4a122b4c8a53db388 | 7,097 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 ... | 53.360902 | 286 | 0.748908 |
from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer
from . import models
from ._configuration import ContainerRegistryManagementClientConfigurat... | true | true |
f72b097de1b2982d94f31803515377aa94536b9a | 1,869 | py | Python | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | """deny tests"""
from django.urls import reverse
from authentik.core.tests.utils import create_test_admin_user, create_test_flow
from authentik.flows.markers import StageMarker
from authentik.flows.models import FlowDesignation, FlowStageBinding
from authentik.flows.planner import FlowPlan
from authentik.flows.tests i... | 38.9375 | 99 | 0.70626 | from django.urls import reverse
from authentik.core.tests.utils import create_test_admin_user, create_test_flow
from authentik.flows.markers import StageMarker
from authentik.flows.models import FlowDesignation, FlowStageBinding
from authentik.flows.planner import FlowPlan
from authentik.flows.tests import FlowTestCas... | true | true |
f72b09d34e7b78c00c0b504b76cded6aa3b45a39 | 1,425 | py | Python | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | 15 | 2021-07-28T19:52:03.000Z | 2022-03-28T15:55:17.000Z | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | 3 | 2021-11-19T17:09:34.000Z | 2022-02-14T19:40:48.000Z | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
from blanc import BlancHelp, BlancTune
def main(args):
kwargs = json.loads(args.kwargs)
device = "cpu" if args.device == -1 else "cuda"
if args.type == "tune":
blanc = BlancTune(device=device, random_seed=args.random_seed, **kwargs)
elif args.type == "hel... | 31.666667 | 80 | 0.655439 | import argparse
import json
import os
from blanc import BlancHelp, BlancTune
def main(args):
kwargs = json.loads(args.kwargs)
device = "cpu" if args.device == -1 else "cuda"
if args.type == "tune":
blanc = BlancTune(device=device, random_seed=args.random_seed, **kwargs)
elif args.type == "hel... | true | true |
f72b0a2e2db8a201933a779f2d9eaf3fc70eda33 | 9,937 | py | Python | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | 22 | 2022-03-18T07:29:31.000Z | 2022-03-23T14:54:32.000Z | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | null | null | null | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | 2 | 2022-03-18T08:26:34.000Z | 2022-03-20T06:02:48.000Z | import tvm
import numpy as np
from tvm import relay
from tvm.relay.testing import run_infer_type, gradient
def get_lenet(batch_size,
num_classes=10,
image_shape=(1, 28, 28),
dtype="float32"):
"""Get lenet funciton
Parameters
----------
batch_size : int
The b... | 36.399267 | 138 | 0.600986 | import tvm
import numpy as np
from tvm import relay
from tvm.relay.testing import run_infer_type, gradient
def get_lenet(batch_size,
num_classes=10,
image_shape=(1, 28, 28),
dtype="float32"):
data_shape = (batch_size,) + image_shape
data = relay.TensorType(data_shape, dtype=... | true | true |
f72b0a4f41647e949ba4e6202d2c7f3980d53dab | 575 | py | Python | M5_assgmnt.py | AVNEETK99/FANTASY-CRICKET-LEAGUE | 17fc188e48a51c6f3937a9965f1edcead2a8d0b8 | [
"CC0-1.0"
] | 23 | 2018-07-18T10:47:12.000Z | 2021-07-31T21:53:17.000Z | M5_assgmnt.py | RupinSamria/Summer-Training-Python-development | 4fa38344d6aa71581b004c16eddeec22f9f739f4 | [
"CC0-1.0"
] | 3 | 2018-11-18T07:11:05.000Z | 2020-04-30T20:16:51.000Z | M5_assgmnt.py | RupinSamria/Summer-Training-Python-development | 4fa38344d6aa71581b004c16eddeec22f9f739f4 | [
"CC0-1.0"
] | 53 | 2018-10-04T05:49:30.000Z | 2021-12-12T15:52:17.000Z | import sqlite3
mystore=sqlite3.connect('bookstores.db')
mycursor=mystore.cursor()
sql=''' create table book (id integer primary key not null,title text(20),
author text(20),price real);'''
mycursor.execute(sql)
sql='''insert into book
values(1,'think java','rhooney',550.0);'''
mycursor.execute(sql)
mystore.c... | 21.296296 | 75 | 0.683478 | import sqlite3
mystore=sqlite3.connect('bookstores.db')
mycursor=mystore.cursor()
sql=''' create table book (id integer primary key not null,title text(20),
author text(20),price real);'''
mycursor.execute(sql)
sql='''insert into book
values(1,'think java','rhooney',550.0);'''
mycursor.execute(sql)
mystore.c... | true | true |
f72b0a5531db17b2a97a3179af5c86bd986dd358 | 12,137 | py | Python | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 49.538776 | 113 | 0.616215 |
import unittest
import os
import tensorflow.compat.v1 as tf
tf.enable_eager_execution()
from google.protobuf import text_format, timestamp_pb2
import tensorflow_io
from tensorflow.compat.v1 import gfile
from fedlearner.common import db_client
from fedlearner.common import common_pb2 as common_pb
from ... | true | true |
f72b0ab4b78ec9b7eb7deec2b8193a86ca41b48e | 938 | py | Python | year_2020/day13/test_day13.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | year_2020/day13/test_day13.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | year_2020/day13/test_day13.py | mjalkio/advent-of-code | 54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42 | [
"MIT"
] | null | null | null | import pytest
from year_2020.day13.shuttle_search import (
get_bus_id_times_wait_time,
get_earliest_bus_and_wait_time_for_airport,
get_shuttle_company_solution,
)
TEST_INPUT = """
939
7,13,x,x,59,x,31,19
"""
TEST_INPUT_2 = """
0
17,x,13,19
"""
TEST_INPUT_3 = """
0
67,7,59,61
"""
TEST_INPUT_4 = """
0
67... | 16.172414 | 76 | 0.672708 | import pytest
from year_2020.day13.shuttle_search import (
get_bus_id_times_wait_time,
get_earliest_bus_and_wait_time_for_airport,
get_shuttle_company_solution,
)
TEST_INPUT = """
939
7,13,x,x,59,x,31,19
"""
TEST_INPUT_2 = """
0
17,x,13,19
"""
TEST_INPUT_3 = """
0
67,7,59,61
"""
TEST_INPUT_4 = """
0
67... | true | true |
f72b0ad54d6dd35fc8e313c9014957d5d7c84c64 | 2,327 | py | Python | TheoryValidation/CirculantGraphs.py | ctralie/GeometricBeatTracking | 2c35183f638c4afb51808c09e46da0f74384cba6 | [
"Apache-2.0"
] | 2 | 2019-11-03T16:59:34.000Z | 2021-04-17T05:41:01.000Z | TheoryValidation/CirculantGraphs.py | ctralie/GeometricBeatTracking | 2c35183f638c4afb51808c09e46da0f74384cba6 | [
"Apache-2.0"
] | null | null | null | TheoryValidation/CirculantGraphs.py | ctralie/GeometricBeatTracking | 2c35183f638c4afb51808c09e46da0f74384cba6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse as sparse
import sys
sys.path.append("..")
from Laplacian import *
def getCirculantAdj(N, lags):
#Setup circular parts
I = range(N)*(len(lags)+2)
J = range(1, N+1) + range(-1, N-1)
J[N-1] = 0
J[N] = N-1
for lag in lags:
... | 26.146067 | 78 | 0.5578 | import numpy as np
import matplotlib.pyplot as plt
import scipy.sparse as sparse
import sys
sys.path.append("..")
from Laplacian import *
def getCirculantAdj(N, lags):
I = range(N)*(len(lags)+2)
J = range(1, N+1) + range(-1, N-1)
J[N-1] = 0
J[N] = N-1
for lag in lags:
J = J + (np.mod(n... | true | true |
f72b0b19c49d94d5feee3fd0a9c9902892c5cb86 | 28,656 | py | Python | Lib/test/test_tempfile.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_tempfile.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_tempfile.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | # tempfile.py unit tests.
import tempfile
import os
import sys
import re
import errno
import warnings
import unittest
from test import support
warnings.filterwarnings("ignore",
category=RuntimeWarning,
message="mktemp", module=__name__)
if hasattr(os, 'stat'):
impo... | 31.559471 | 100 | 0.576947 |
import tempfile
import os
import sys
import re
import errno
import warnings
import unittest
from test import support
warnings.filterwarnings("ignore",
category=RuntimeWarning,
message="mktemp", module=__name__)
if hasattr(os, 'stat'):
import stat
has_stat = 1
... | true | true |
f72b0b29ec60b1e3fa0dcfba14c0246d70315797 | 1,173 | py | Python | peamt/features/polyphony.py | adrienycart/PEAMT | d3ae41e86dedeb64fcf54e2454c9feee993574f9 | [
"MIT"
] | 5 | 2020-05-28T18:03:58.000Z | 2021-11-01T13:14:26.000Z | peamt/features/polyphony.py | adrienycart/PEAMT | d3ae41e86dedeb64fcf54e2454c9feee993574f9 | [
"MIT"
] | 5 | 2020-09-26T01:12:41.000Z | 2022-02-10T02:01:25.000Z | peamt/features/polyphony.py | adrienycart/PEAMT | d3ae41e86dedeb64fcf54e2454c9feee993574f9 | [
"MIT"
] | null | null | null | import numpy as np
########################################
### Polyphony --- discarded
########################################
def polyphony_level_diff(roll_output,roll_target):
poly_output = np.sum(roll_output,axis=0)
poly_target = np.sum(roll_target,axis=0)
poly_diff = np.abs(poly_output-poly_target... | 30.076923 | 87 | 0.656436 | import numpy as np
| true | true |
f72b0bcdbe61d8b42e2ce9462ada3ba434fd8b03 | 2,078 | py | Python | tests/common/test_run/round_run.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/round_run.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/round_run.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.961538 | 120 | 0.702117 |
import numpy as np
import secrets
from tests.common.tensorio import compare_tensor
from akg.utils import kernel_exec as utils
from tests.common.test_op import round
from tests.common.gen_random import random_gaussian
secretsGenerator = secrets.SystemRandom()
def round_run(shape, dtype, attrs):
in_shap... | true | true |
f72b0bdf689c564a67a58c7ea477390e6e8c6c23 | 24,215 | py | Python | homeassistant/components/mqtt/fan.py | wlcrs/core | cf27b82d2fdce406fda3b1b9cd52d42d7f7d00d6 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mqtt/fan.py | wlcrs/core | cf27b82d2fdce406fda3b1b9cd52d42d7f7d00d6 | [
"Apache-2.0"
] | 7 | 2022-03-01T06:32:08.000Z | 2022-03-31T07:20:49.000Z | homeassistant/components/mqtt/fan.py | fblondeau/home-assistant | a8da0eedd32ac8198f06d4e32622d0f8b40b4a41 | [
"Apache-2.0"
] | null | null | null | """Support for MQTT fans."""
from __future__ import annotations
import asyncio
import functools
import logging
import math
import voluptuous as vol
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_OSCILLATING,
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanEntity,
F... | 36.800912 | 102 | 0.663556 | from __future__ import annotations
import asyncio
import functools
import logging
import math
import voluptuous as vol
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_OSCILLATING,
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanEntity,
FanEntityFeature,
)
from homea... | true | true |
f72b0d77ba36f92d632793f510174fe192e614ec | 390 | py | Python | src/utils.py | CarlSchader/poker-api | 446c036367fdb75f5b0fd7f93f347d839bbf71b6 | [
"MIT"
] | null | null | null | src/utils.py | CarlSchader/poker-api | 446c036367fdb75f5b0fd7f93f347d839bbf71b6 | [
"MIT"
] | null | null | null | src/utils.py | CarlSchader/poker-api | 446c036367fdb75f5b0fd7f93f347d839bbf71b6 | [
"MIT"
] | null | null | null | import functools
def dict_cmp(x, y, key):
if str(x[key]) > str(y[key]):
return 1
elif str(x[key]) < str(y[key]):
return -1
else:
return 0
def sort_dict(dictionary, cmp_func):
arr = []
for key in dictionary:
arr.append((key, dictionary[key]))
arr.sort(key=fu... | 22.941176 | 74 | 0.574359 | import functools
def dict_cmp(x, y, key):
if str(x[key]) > str(y[key]):
return 1
elif str(x[key]) < str(y[key]):
return -1
else:
return 0
def sort_dict(dictionary, cmp_func):
arr = []
for key in dictionary:
arr.append((key, dictionary[key]))
arr.sort(key=fu... | true | true |
f72b0e39b7ac8a2190ca5bc480dd257ebdc5b8a6 | 290 | py | Python | generate/partial-header/dataclass/annotation.py | kurusugawa-computer/annofab-api-python-client | 9920e0745f1ee8ea79c26e26a61013b415351982 | [
"MIT"
] | 17 | 2019-05-04T04:24:28.000Z | 2021-12-14T02:43:24.000Z | generate/partial-header/dataclass/annotation.py | kurusugawa-computer/annofab-api-python-client | 9920e0745f1ee8ea79c26e26a61013b415351982 | [
"MIT"
] | 214 | 2019-05-13T01:07:28.000Z | 2022-03-28T20:02:34.000Z | generate/partial-header/dataclass/annotation.py | kurusugawa-computer/annofab-api-python-client | 9920e0745f1ee8ea79c26e26a61013b415351982 | [
"MIT"
] | 2 | 2019-06-15T05:01:50.000Z | 2019-07-04T02:29:55.000Z | from annofabapi.models import (
AdditionalDataDefinitionType,
AnnotationDataHoldingType,
AnnotationType,
InternationalizationMessage,
TaskPhase,
TaskStatus,
)
AnnotationData = Union[str, Dict[str, Any]]
FullAnnotationData = Any
AdditionalDataValue = Dict[str, Any]
| 22.307692 | 43 | 0.762069 | from annofabapi.models import (
AdditionalDataDefinitionType,
AnnotationDataHoldingType,
AnnotationType,
InternationalizationMessage,
TaskPhase,
TaskStatus,
)
AnnotationData = Union[str, Dict[str, Any]]
FullAnnotationData = Any
AdditionalDataValue = Dict[str, Any]
| true | true |
f72b0f69d6927ac9a2071aaa3c495a33948a8289 | 7,677 | py | Python | homeassistant/components/epson/media_player.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/epson/media_player.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/epson/media_player.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Support for Epson projector."""
from __future__ import annotations
import logging
from epson_projector.const import (
BACK,
BUSY,
CMODE,
CMODE_LIST,
CMODE_LIST_SET,
DEFAULT_SOURCES,
EPSON_CODES,
FAST,
INV_SOURCES,
MUTE,
PAUSE,
PLAY,
POWER,
SOURCE,
SOURCE_... | 31.592593 | 88 | 0.655464 | from __future__ import annotations
import logging
from epson_projector.const import (
BACK,
BUSY,
CMODE,
CMODE_LIST,
CMODE_LIST_SET,
DEFAULT_SOURCES,
EPSON_CODES,
FAST,
INV_SOURCES,
MUTE,
PAUSE,
PLAY,
POWER,
SOURCE,
SOURCE_LIST,
STATE_UNAVAILABLE as EPSO... | true | true |
f72b112a2a1fc41633e4d17514fd8efbba957fc5 | 299 | py | Python | World 02/Class 13/ex050.py | DanielRios549/PythonExcercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | 6 | 2021-05-04T22:09:16.000Z | 2022-01-08T20:27:39.000Z | World 02/Class 13/ex050.py | DanielRios549/PythonExercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | null | null | null | World 02/Class 13/ex050.py | DanielRios549/PythonExercises | acb44a7cc383e8534f47bc59235d9cc04fd83880 | [
"MIT"
] | null | null | null | '''
Get 6 integer numbers and show the sum of the even ones. Do not consider the odd ones.
'''
sum_number = 0
for count in range(0, 6):
number = int(input('Choose a number: '))
if number % 2 == 0:
sum_number += number
print(f'The sum of all even numbers equals {sum_number}')
| 23 | 90 | 0.64214 | sum_number = 0
for count in range(0, 6):
number = int(input('Choose a number: '))
if number % 2 == 0:
sum_number += number
print(f'The sum of all even numbers equals {sum_number}')
| true | true |
f72b11dd0aed4940421d5a68bccc46f47f43bad2 | 6,464 | py | Python | integrations/tensorflow/e2e/conv_test.py | rise-lang/iree | 46ad3fe392d38ce3df6eff7826cc1ab331a40b72 | [
"Apache-2.0"
] | null | null | null | integrations/tensorflow/e2e/conv_test.py | rise-lang/iree | 46ad3fe392d38ce3df6eff7826cc1ab331a40b72 | [
"Apache-2.0"
] | null | null | null | integrations/tensorflow/e2e/conv_test.py | rise-lang/iree | 46ad3fe392d38ce3df6eff7826cc1ab331a40b72 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36.937143 | 79 | 0.642481 |
import numpy as np
from pyiree.tf.support import tf_test_utils
import tensorflow.compat.v2 as tf
class Conv2dModule(tf.Module):
@tf.function(input_signature=[
tf.TensorSpec([1, 4, 5, 1], tf.float32),
tf.TensorSpec([1, 1, 1, 1], tf.float32),
])
def conv2d_1451x1111_valid(self, img, ke... | true | true |
f72b11f17c30ee2bf5b08acdb6fe426742382acd | 26,208 | py | Python | lib/ansiblelint/utils.py | gdoucet/ansible-lint | 07b5194b44f6979480f57b96ea3d196fb59c0e7c | [
"MIT"
] | 1 | 2020-01-21T04:30:10.000Z | 2020-01-21T04:30:10.000Z | lib/ansiblelint/utils.py | gdoucet/ansible-lint | 07b5194b44f6979480f57b96ea3d196fb59c0e7c | [
"MIT"
] | null | null | null | lib/ansiblelint/utils.py | gdoucet/ansible-lint | 07b5194b44f6979480f57b96ea3d196fb59c0e7c | [
"MIT"
] | null | null | null | # Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 35.657143 | 100 | 0.618781 |
import glob
import imp
import os
from itertools import product
import six
from ansible import constants
from ansible.errors import AnsibleError
try:
from ansible.parsing.splitter import split_args
except ImportError:
# Fallback on the Ansible 1.9 module
from ansible.module_utils.... | true | true |
f72b120e0e4865b2e5c26ca09713f83332de05bd | 43,459 | py | Python | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | tanner-bruce/integrations-core | 36337b84fefb73e94d4f1ee28aaeb669dc12fb59 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2016-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import re
import time
from collections import Counter, defaultdict
from copy import deepcopy
from six import iteritems
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.co... | 52.046707 | 145 | 0.625463 |
import re
import time
from collections import Counter, defaultdict
from copy import deepcopy
from six import iteritems
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.config import is_affirmative
from datadog_checks.errors import CheckException
from datadog_checks.utils.comm... | true | true |
f72b12c2828be5260fdd70ad443c19b16f2923f0 | 3,003 | py | Python | bin/stock_price_scraper.py | Samanvay96/asx_scraper | 4b80ff97bc3d1005aef005c82bd0a6c20d8733dc | [
"MIT"
] | null | null | null | bin/stock_price_scraper.py | Samanvay96/asx_scraper | 4b80ff97bc3d1005aef005c82bd0a6c20d8733dc | [
"MIT"
] | null | null | null | bin/stock_price_scraper.py | Samanvay96/asx_scraper | 4b80ff97bc3d1005aef005c82bd0a6c20d8733dc | [
"MIT"
] | null | null | null | import urllib.request
from datetime import datetime
import string
from argparse import ArgumentParser
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from bs4 import BeautifulSoup
from sortedcontainers import SortedDict
class StockPriceScraper:
def __init__(self, base_url, stoc... | 48.435484 | 183 | 0.652681 | import urllib.request
from datetime import datetime
import string
from argparse import ArgumentParser
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from bs4 import BeautifulSoup
from sortedcontainers import SortedDict
class StockPriceScraper:
def __init__(self, base_url, stoc... | true | true |
f72b1364a37162fb740d304ac9506ad71a4279ec | 17,209 | py | Python | bitshares/asset.py | ianco/python-bitshares | f9fb23bc32f7bf6ebabb295df8f4056d84f0e859 | [
"MIT"
] | null | null | null | bitshares/asset.py | ianco/python-bitshares | f9fb23bc32f7bf6ebabb295df8f4056d84f0e859 | [
"MIT"
] | null | null | null | bitshares/asset.py | ianco/python-bitshares | f9fb23bc32f7bf6ebabb295df8f4056d84f0e859 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from bitsharesbase import operations
from bitsharesbase.asset_permissions import (
asset_permissions,
force_flag,
test_permissions,
todict,
)
from .blockchainobject import BlockchainObject
from .exceptions import AssetDoesNotExistsException
from .instance import Bloc... | 35.192229 | 88 | 0.534895 |
import json
from bitsharesbase import operations
from bitsharesbase.asset_permissions import (
asset_permissions,
force_flag,
test_permissions,
todict,
)
from .blockchainobject import BlockchainObject
from .exceptions import AssetDoesNotExistsException
from .instance import BlockchainInstance
from gr... | true | true |
f72b1485c5de36b36b7c1db7dbc892f1eac0ef05 | 7,375 | py | Python | recipes/Python/576780_Timeout_for_nearly_any_callable/recipe-576780.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/576780_Timeout_for_nearly_any_callable/recipe-576780.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/576780_Timeout_for_nearly_any_callable/recipe-576780.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | #!/usr/bin/env python
'''This module exposes function timelimited and two
classes TimeLimited and TimeLimitExpired.
Function timelimited can be used to invoke any
callable object with a time limit.
Class TimeLimited wraps any callable object into a
time limited callable with an equivalent signatu... | 29.979675 | 91 | 0.603254 |
'''This module exposes function timelimited and two
classes TimeLimited and TimeLimitExpired.
Function timelimited can be used to invoke any
callable object with a time limit.
Class TimeLimited wraps any callable object into a
time limited callable with an equivalent signature.
Beware, any c... | false | true |
f72b17196b95f01f3e9c02c59d337099f3b510e2 | 18,401 | py | Python | fedlearner/trainer/estimator.py | bruinxiong/fedlearner | 9cdeaf44b279acedd5bc88bbffd4a390697b06aa | [
"Apache-2.0"
] | 1 | 2020-12-02T09:51:29.000Z | 2020-12-02T09:51:29.000Z | fedlearner/trainer/estimator.py | bruinxiong/fedlearner | 9cdeaf44b279acedd5bc88bbffd4a390697b06aa | [
"Apache-2.0"
] | null | null | null | fedlearner/trainer/estimator.py | bruinxiong/fedlearner | 9cdeaf44b279acedd5bc88bbffd4a390697b06aa | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.915401 | 80 | 0.577469 |
import os
import logging
import time
import tensorflow.compat.v1 as tf
from tensorflow.compat import as_str_any
from tensorflow.compat.v1.train import Optimizer
from tensorflow.compat.v1.estimator import ModeKeys
from tensorflow_estimator.python.estimator import model_fn as model_fn_lib
from fedlearn... | true | true |
f72b173c37bf64ae1456501212bb02ffe852962a | 2,398 | py | Python | sdk/python/pulumi_azure_native/azurestack/v20200601preview/get_registration_activation_key.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/azurestack/v20200601preview/get_registration_activation_key.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/azurestack/v20200601preview/get_registration_activation_key.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 36.333333 | 175 | 0.710592 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = [
'GetRegistrationActivationKeyResult',
'AwaitableGetRegistrationActivationKeyResult',
'get_registration_activation_key',
]
@pulumi.output_type
... | true | true |
f72b176a16e94f285b596a275b3c38e265d42aba | 11,711 | py | Python | onmt/model_builder.py | Nazukixv/OpenNMT-py | 6265ddbbe9053b018714ac1fb4be9ec8adbaa128 | [
"MIT"
] | 11 | 2019-11-22T16:46:36.000Z | 2021-07-17T04:06:14.000Z | onmt/model_builder.py | Nazukixv/OpenNMT-py | 6265ddbbe9053b018714ac1fb4be9ec8adbaa128 | [
"MIT"
] | 3 | 2019-11-11T05:40:10.000Z | 2020-03-05T14:04:38.000Z | onmt/model_builder.py | Nazukixv/OpenNMT-py | 6265ddbbe9053b018714ac1fb4be9ec8adbaa128 | [
"MIT"
] | 3 | 2020-04-04T12:21:52.000Z | 2022-02-27T13:29:45.000Z | """
This file is for models creation, which consults options
and creates each encoder and decoder accordingly.
"""
import re
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.enc... | 40.663194 | 79 | 0.59252 | import re
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.encoders.transformer import TransformerEncoder
from onmt.encoders.cnn_encoder import CNNEncoder
from onmt.encoders.mea... | true | true |
f72b18ac7bf95dbe78dbadf8c1485e348aca0705 | 870 | py | Python | code/extractWAVdata.py | eepsmedia/ping-pong-bounce | 8e06363032da88976f14146704af26d9312d195a | [
"MIT"
] | null | null | null | code/extractWAVdata.py | eepsmedia/ping-pong-bounce | 8e06363032da88976f14146704af26d9312d195a | [
"MIT"
] | null | null | null | code/extractWAVdata.py | eepsmedia/ping-pong-bounce | 8e06363032da88976f14146704af26d9312d195a | [
"MIT"
] | null | null | null | """Convert a .wav file to .csv
Uses the `wave` package to convert a .wav file to a .csv.
Assumes that the file is monoaural (one channel).
Be sure to edit the code to point to correct values of `inFileName` and `outFileName`
"""
import wave
import numpy
inFileName = "../data/pingpong.wav"
outFileName = '../data/pi... | 22.894737 | 85 | 0.658621 |
import wave
import numpy
inFileName = "../data/pingpong.wav"
outFileName = '../data/pingpong raw redux.csv'
f = wave.open(inFileName, 'rb')
params = f.getparams()
print("There are {} frames.".format(params.nframes))
bytesData = f.readframes(params.nframes)
f.close()
a = numpy.frombuffer(bytesData, dtype=numpy.dty... | true | true |
f72b18b4de5b0fdf2cba2aac9ddd50531ba9f7c0 | 2,145 | py | Python | setup.py | hindman/short-con | 45242757ab50a3b8b8b9826704a58006f918955d | [
"MIT"
] | null | null | null | setup.py | hindman/short-con | 45242757ab50a3b8b8b9826704a58006f918955d | [
"MIT"
] | null | null | null | setup.py | hindman/short-con | 45242757ab50a3b8b8b9826704a58006f918955d | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from os.path import dirname, realpath, join
from setuptools import setup, find_packages
import sys
####
# Basic project info.
####
project_name = 'short-con'
package_name = project_name.replace('-', '_')
repo_name = project_name
description = 'Constants collections without boilerplate'
url... | 21.029412 | 72 | 0.635897 |
from os.path import dirname, realpath, join
from setuptools import setup, find_packages
import sys
name = 'short-con'
package_name = project_name.replace('-', '_')
repo_name = project_name
description = 'Constants collections without boilerplate'
url = 'https://github.com/hindman/' + repo_name
author ... | true | true |
f72b19bcddea7c052af0ab512ac1b3f2f93a86bf | 112,844 | py | Python | tensorflow/python/ops/variables.py | m4rkl1u/tensorflow | 90a8825c7ae9719e8969d45040b4155b0e7de130 | [
"Apache-2.0"
] | 1 | 2019-01-14T07:11:06.000Z | 2019-01-14T07:11:06.000Z | tensorflow/python/ops/variables.py | m4rkl1u/tensorflow | 90a8825c7ae9719e8969d45040b4155b0e7de130 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/variables.py | m4rkl1u/tensorflow | 90a8825c7ae9719e8969d45040b4155b0e7de130 | [
"Apache-2.0"
] | 2 | 2019-02-26T16:21:15.000Z | 2020-12-04T17:48:17.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.135857 | 134 | 0.682659 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import enum
import functools
import os
import six
from tensorflow.core.framework import attr_value_pb2
from tensorflow.core.framework import variable_pb2
from tensorflow.python.eager import con... | true | true |
f72b1a1f689e870dc85c7c284ed9fdf8f206b085 | 4,540 | py | Python | python/tests/serialization/test_deserializers.py | aji-geo/incubator-sedona | ed7a1badf58f0c7efedf79a0a21a9ef6ebd1d6b1 | [
"Apache-2.0"
] | 1 | 2021-10-19T07:57:29.000Z | 2021-10-19T07:57:29.000Z | python/tests/serialization/test_deserializers.py | aji-geo/incubator-sedona | ed7a1badf58f0c7efedf79a0a21a9ef6ebd1d6b1 | [
"Apache-2.0"
] | null | null | null | python/tests/serialization/test_deserializers.py | aji-geo/incubator-sedona | ed7a1badf58f0c7efedf79a0a21a9ef6ebd1d6b1 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 36.32 | 112 | 0.624009 |
import os
from shapely.geometry import MultiPoint, Point, MultiLineString, LineString, Polygon, MultiPolygon
import geopandas as gpd
from tests.data import data_path
from tests.test_base import TestBase
class TestGeometryConvert(TestBase):
def test_register_functions(self):
df = self.s... | true | true |
f72b1cc1e0211ba34f94051f87bc32ad2cbf8b6f | 60 | py | Python | src/FLABasicTools/__main__.py | Fair-Lines-America/FLA_basic_tools | 9aedc23ef4b9df2bd530c96fedd94e046eb545c8 | [
"MIT"
] | 17 | 2020-05-07T20:02:30.000Z | 2022-03-02T10:59:28.000Z | src/FLABasicTools/__main__.py | Fair-Lines-America/FLA_basic_tools | 9aedc23ef4b9df2bd530c96fedd94e046eb545c8 | [
"MIT"
] | 3 | 2021-05-06T17:44:23.000Z | 2022-01-27T15:14:44.000Z | src/FLABasicTools/__main__.py | Fair-Lines-America/FLA_basic_tools | 9aedc23ef4b9df2bd530c96fedd94e046eb545c8 | [
"MIT"
] | null | null | null | from .cli import main
if __name__ == '__main__':
main() | 15 | 26 | 0.65 | from .cli import main
if __name__ == '__main__':
main() | true | true |
f72b1d438ff6542f0231c5e19b54a4ca0fdfaef9 | 7,860 | py | Python | agent/segmentation.py | johnnylord/trytry-segmentation | a88d75571ddba92bd10ac2d7303bee9426188b62 | [
"MIT"
] | null | null | null | agent/segmentation.py | johnnylord/trytry-segmentation | a88d75571ddba92bd10ac2d7303bee9426188b62 | [
"MIT"
] | null | null | null | agent/segmentation.py | johnnylord/trytry-segmentation | a88d75571ddba92bd10ac2d7303bee9426188b62 | [
"MIT"
] | null | null | null | import os
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as T
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
from data.segmentation import SegmentDataset
from model.segmentation.fcn import FCN32
from... | 38.341463 | 91 | 0.549237 | import os
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as T
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
from data.segmentation import SegmentDataset
from model.segmentation.fcn import FCN32
from... | true | true |
f72b1e7549524106a9f828129970b89627719521 | 51,593 | py | Python | temporal/core.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/core.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/core.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | """
This module provides the functionality to create the temporal
SQL database and to establish a connection to the database.
Usage:
.. code-block:: python
>>> import grass.temporal as tgis
>>> # Create the temporal database
>>> tgis.init()
>>> # Establish a database connection
>>> dbif, connecte... | 37.170749 | 100 | 0.589111 |
import os
import sys
import grass.script as gscript
if sys.version_info.major == 3:
long = int
from .c_libraries_interface import *
from grass.pygrass import messages
from grass.script.utils import decode, encode
try:
import sqlite3
except ImportError:
pass
try:
import psycopg2
import psycopg2... | true | true |
f72b21cb7cd90c4cedf514ee804f2b47f748ee67 | 4,395 | py | Python | runner.py | Robinson04/mdscript | 7a89a4453f0266a5ed318eceebc12b401e419ff4 | [
"MIT"
] | null | null | null | runner.py | Robinson04/mdscript | 7a89a4453f0266a5ed318eceebc12b401e419ff4 | [
"MIT"
] | 1 | 2021-07-27T21:03:40.000Z | 2021-07-27T21:03:40.000Z | runner.py | Robinson04/mdscript | 7a89a4453f0266a5ed318eceebc12b401e419ff4 | [
"MIT"
] | null | null | null | import logging
import os
import re
from pathlib import Path
from typing import Any
from mdscript.files_dependencies_manager import FilesDependenciesManager
from mdscript.watcher import Watcher
class Runner:
def __init__(self, config: Any, base_dirpath: str):
self.config = config
self.base_dirpath... | 49.943182 | 145 | 0.669852 | import logging
import os
import re
from pathlib import Path
from typing import Any
from mdscript.files_dependencies_manager import FilesDependenciesManager
from mdscript.watcher import Watcher
class Runner:
def __init__(self, config: Any, base_dirpath: str):
self.config = config
self.base_dirpath... | true | true |
f72b239857d42e26a3ecdb3d5902e5cf5b358e32 | 2,569 | py | Python | verilator/dut_gen.py | mlulaj/fuzzing | 81e17a3363490361475bfd9ae28a5ae495be27b8 | [
"BSD-3-Clause"
] | 48 | 2018-09-26T03:35:37.000Z | 2022-03-20T05:05:56.000Z | verilator/dut_gen.py | mlulaj/fuzzing | 81e17a3363490361475bfd9ae28a5ae495be27b8 | [
"BSD-3-Clause"
] | 10 | 2018-07-19T21:16:22.000Z | 2021-09-06T22:21:01.000Z | verilator/dut_gen.py | mlulaj/fuzzing | 81e17a3363490361475bfd9ae28a5ae495be27b8 | [
"BSD-3-Clause"
] | 6 | 2020-02-06T01:33:54.000Z | 2021-08-29T21:20:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018, Kevin Laeufer <ekiwi@berkeley.edu>
# Generates the `dut.hpp` file which contains dut specific interface code
# from the TOML dut description file.
import os, sys, argparse
import toml
template = """
// This file was generated from {conf_toml} using th... | 30.583333 | 82 | 0.708836 |
import os, sys, argparse
import toml
template = """
// This file was generated from {conf_toml} using the dut_gen.py script.
// It contains DUt specific interface code for the verilator C++ test harness.
#ifndef DUT_CONF_HPP
#define DUT_CONF_HPP
#if defined(E2E)
#include <V{toplevel}_E2EHarness.h>
#define TO... | true | true |
f72b24aadd868431479c08d35f7980c4d40e563c | 5,289 | py | Python | deepctr/models/din.py | BradyBromley/DeepCTR | 3d12ffc0e0a5e893dce8bd315824c180445b772e | [
"Apache-2.0"
] | 2 | 2019-11-07T10:17:40.000Z | 2020-04-13T14:25:14.000Z | deepctr/models/din.py | BradyBromley/DeepCTR | 3d12ffc0e0a5e893dce8bd315824c180445b772e | [
"Apache-2.0"
] | 7 | 2019-12-16T22:22:25.000Z | 2022-02-10T00:37:34.000Z | deepctr/models/din.py | BradyBromley/DeepCTR | 3d12ffc0e0a5e893dce8bd315824c180445b772e | [
"Apache-2.0"
] | 1 | 2020-01-07T09:12:21.000Z | 2020-01-07T09:12:21.000Z | # -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Zhou G, Zhu X, Song C, et al. Deep interest network for click-through rate prediction[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2018: 1059-1068. (https://arxiv.org/... | 52.366337 | 256 | 0.772169 |
from tensorflow.python.keras.layers import Dense,Concatenate, Flatten
from tensorflow.python.keras.models import Model
from ..inputs import build_input_features,create_embedding_matrix,SparseFeat,VarLenSparseFeat,DenseFeat,embedding_lookup,get_dense_input,varlen_embedding_lookup,get_varlen_pooling_list,combined_dn... | true | true |
f72b252e105b7da5db34c619077f0de2012fa5c7 | 301 | py | Python | deeplab3/evaluators/__init__.py | crmauceri/pytorch-deeplab-xception | aec2cb7b0c09c346519c6bf22c2cbf419021fdc7 | [
"MIT"
] | 1 | 2021-12-11T08:21:19.000Z | 2021-12-11T08:21:19.000Z | deeplab3/evaluators/__init__.py | crmauceri/rgbd_deeplab | aec2cb7b0c09c346519c6bf22c2cbf419021fdc7 | [
"MIT"
] | null | null | null | deeplab3/evaluators/__init__.py | crmauceri/rgbd_deeplab | aec2cb7b0c09c346519c6bf22c2cbf419021fdc7 | [
"MIT"
] | null | null | null | from deeplab3.evaluators.segmentation_evaluator import SegmentationEvaluator
def make_evaluator(cfg, num_classes):
if cfg.EVALUATOR.NAME == "segmentation":
return SegmentationEvaluator(num_classes)
else:
raise ValueError("Model not implemented: {}".format(cfg.EVALUATOR.NAME)) | 43 | 80 | 0.76412 | from deeplab3.evaluators.segmentation_evaluator import SegmentationEvaluator
def make_evaluator(cfg, num_classes):
if cfg.EVALUATOR.NAME == "segmentation":
return SegmentationEvaluator(num_classes)
else:
raise ValueError("Model not implemented: {}".format(cfg.EVALUATOR.NAME)) | true | true |
f72b25859b28cd579a78605dc1ed921ca8af258c | 3,159 | py | Python | analytics/models.py | SmithJesko/volny-films | 7c50713eb1d2c2d5984700a5de20a12e4045e1b9 | [
"MIT"
] | 1 | 2021-02-23T00:12:43.000Z | 2021-02-23T00:12:43.000Z | analytics/models.py | SmithJesko/volny-films | 7c50713eb1d2c2d5984700a5de20a12e4045e1b9 | [
"MIT"
] | null | null | null | analytics/models.py | SmithJesko/volny-films | 7c50713eb1d2c2d5984700a5de20a12e4045e1b9 | [
"MIT"
] | 1 | 2021-02-23T06:04:13.000Z | 2021-02-23T06:04:13.000Z | from django.contrib.auth import get_user_model
from django.db import models
User = get_user_model()
class ClientConnection(models.Model):
ip = models.CharField(max_length=50, default="xxx", blank=True, null=True)
url = models.CharField(max_length=512, default="xxx", blank=True, null=True)
timestamp = mod... | 41.565789 | 83 | 0.719848 | from django.contrib.auth import get_user_model
from django.db import models
User = get_user_model()
class ClientConnection(models.Model):
ip = models.CharField(max_length=50, default="xxx", blank=True, null=True)
url = models.CharField(max_length=512, default="xxx", blank=True, null=True)
timestamp = mod... | true | true |
f72b2611795c1b7d27319858d6c69d00eadf80ef | 32,514 | py | Python | old_projects/eola/chapter8p2.py | thevivekpandey/manim | 483dbfc232fa684e7722969221bd416fde8bd55a | [
"MIT"
] | 9 | 2019-12-17T04:59:53.000Z | 2020-11-10T21:02:41.000Z | old_projects/eola/chapter8p2.py | Hammer7/manim | a19a6317ec187f65efb0c8f46bc613b4a978d22a | [
"MIT"
] | 5 | 2021-03-19T03:01:04.000Z | 2022-03-11T23:57:24.000Z | old_projects/eola/chapter8p2.py | Hammer7/manim | a19a6317ec187f65efb0c8f46bc613b4a978d22a | [
"MIT"
] | 3 | 2020-04-12T16:50:57.000Z | 2020-07-19T17:53:53.000Z | from manimlib.imports import *
from old_projects.eola.chapter5 import get_det_text
from old_projects.eola.chapter8 import *
class OpeningQuote(Scene):
def construct(self):
words = TextMobject(
"From [Grothendieck], I have also learned not",
"to take glory in the ",
"di... | 32.975659 | 82 | 0.557637 | from manimlib.imports import *
from old_projects.eola.chapter5 import get_det_text
from old_projects.eola.chapter8 import *
class OpeningQuote(Scene):
def construct(self):
words = TextMobject(
"From [Grothendieck], I have also learned not",
"to take glory in the ",
"di... | true | true |
f72b264401ddefa4e28e25f16a1019753ba3292c | 1,370 | py | Python | python/coffer/coins/btc.py | Steve132/wallet_standard | 09c909b24dc17cf6a0a433644d8f1912e886ab1c | [
"MIT"
] | null | null | null | python/coffer/coins/btc.py | Steve132/wallet_standard | 09c909b24dc17cf6a0a433644d8f1912e886ab1c | [
"MIT"
] | null | null | null | python/coffer/coins/btc.py | Steve132/wallet_standard | 09c909b24dc17cf6a0a433644d8f1912e886ab1c | [
"MIT"
] | null | null | null | from ..wallet import *
from _coin import *
from ..bip32 import Bip32
from blockchain._insight import InsightBlockchainInterface
from blockchain._interface import MultiBlockchainInterface
from impl._segwitcoin import *
class BTC(SegwitCoin):
def __init__(self,is_testnet=False):
#self.supported=True
if(not is_test... | 26.346154 | 75 | 0.734307 | from ..wallet import *
from _coin import *
from ..bip32 import Bip32
from blockchain._insight import InsightBlockchainInterface
from blockchain._interface import MultiBlockchainInterface
from impl._segwitcoin import *
class BTC(SegwitCoin):
def __init__(self,is_testnet=False):
if(not is_testnet):
pkh_prefix=... | true | true |
f72b27956bef78d99560b5b1289b72d9c87c03d4 | 1,672 | py | Python | adminmgr/media/code/A3/task2/BD_151_987_1496_1503_KYP9LpV.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/A3/task2/BD_151_987_1496_1503_KYP9LpV.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/A3/task2/BD_151_987_1496_1503_KYP9LpV.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | from pyspark.sql import SparkSession
from pyspark.sql.functions import explode,split,desc,max
from pyspark.sql.types import *
from pyspark.sql.types import StringType, StructType, StructField
spark = SparkSession \
.builder \
.appName("StructuredStreaming") \
.getOrCreate()
inputpath="hdfs://localhost:9000... | 44 | 117 | 0.600478 | from pyspark.sql import SparkSession
from pyspark.sql.functions import explode,split,desc,max
from pyspark.sql.types import *
from pyspark.sql.types import StringType, StructType, StructField
spark = SparkSession \
.builder \
.appName("StructuredStreaming") \
.getOrCreate()
inputpath="hdfs://localhost:9000... | true | true |
f72b2840162bfc1b4ca923abd4640365761a2d0e | 19,645 | py | Python | wagtail_wordpress_import/test/tests/test_wordpress_item.py | fabienheureux/wagtail-wordpress-import | 3c27330258e24a6b52f3d580060f607706bbc9d0 | [
"MIT"
] | null | null | null | wagtail_wordpress_import/test/tests/test_wordpress_item.py | fabienheureux/wagtail-wordpress-import | 3c27330258e24a6b52f3d580060f607706bbc9d0 | [
"MIT"
] | null | null | null | wagtail_wordpress_import/test/tests/test_wordpress_item.py | fabienheureux/wagtail-wordpress-import | 3c27330258e24a6b52f3d580060f607706bbc9d0 | [
"MIT"
] | null | null | null | import json
import os
import re
import unittest
from collections import Counter
from datetime import datetime
from unittest import mock
from xml.dom import pulldom
from django.test import TestCase, override_settings
from wagtail.core.models import Page
from example.models import Category
from wagtail_wordpress_import... | 40.256148 | 114 | 0.67269 | import json
import os
import re
import unittest
from collections import Counter
from datetime import datetime
from unittest import mock
from xml.dom import pulldom
from django.test import TestCase, override_settings
from wagtail.core.models import Page
from example.models import Category
from wagtail_wordpress_import... | true | true |
f72b287c0755998110f1fa14c9a7bd080f42dee2 | 1,251 | py | Python | azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.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 ... | 36.794118 | 85 | 0.631495 |
from msrest.serialization import Model
class ExpressRouteCircuitsRoutesTableSummaryListResult(Model):
_attribute_map = {
'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(self, value=No... | true | true |
f72b28a897f88f7a2835dba9ffb1efe2af6ae2d4 | 4,626 | py | Python | purity_fb/purity_fb_1dot8dot1/models/alert_watcher_test_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot8dot1/models/alert_watcher_test_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot8dot1/models/alert_watcher_test_response.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.8.1 Python SDK
Pure Storage FlashBlade REST 1.8.1 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.8.1
Cont... | 30.635762 | 206 | 0.607436 |
import pprint
import re
import six
class AlertWatcherTestResponse(object):
__test__ = False
swagger_types = {
'pagination_info': 'PaginationInfo',
'items': 'list[AlertWatcherTest]'
}
attribute_map = {
'pagination_info': 'pagination_info',
'items': 'item... | true | true |
f72b28d1d6a43d1771d51b5748f4617a33315439 | 7,739 | py | Python | code/searchJeuxDeMots.py | AnthonySigogne/HackatonIWCS2017 | d0683a1c8246b75d110984207ec1f1cee67accef | [
"MIT"
] | 1 | 2017-11-20T17:30:31.000Z | 2017-11-20T17:30:31.000Z | code/searchJeuxDeMots.py | AnthonySigogne/HackatonIWCS2017 | d0683a1c8246b75d110984207ec1f1cee67accef | [
"MIT"
] | null | null | null | code/searchJeuxDeMots.py | AnthonySigogne/HackatonIWCS2017 | d0683a1c8246b75d110984207ec1f1cee67accef | [
"MIT"
] | null | null | null | #!/usr/sfw/bin/python
# -*- coding: utf-8 -*-
#C:\python27\python.exe C:\Dropbox\Work\2012ExpressionsComposees\CreateGraph.py
import sys, os, re, string, time
from math import *
#------------------------------
# Chargement des paramètres
#------------------------------
args={}
i=1;
selectedRelations = {}
selectedRel... | 35.663594 | 124 | 0.505492 |
import sys, os, re, string, time
from math import *
args={}
i=1;
selectedRelations = {}
selectedRelations[6] = "r_isa"
selectedRelations[9] = "r_has_part"
selectedRelations[16] = "r_instr"
selectedRelations[17] = "r_carac"
selectedRelations[23] = "r_carac-1"
selectedRelations[15] = "r_lieu"
selectedRelations[2... | true | true |
f72b28ec393014292fff2aac3ffa0f3a488e9bda | 170 | py | Python | handlers/sr.py | flaviopicci/xen-backup | 306667f6ce3fd81d98b7a73312e37ad01f91c287 | [
"Apache-2.0"
] | null | null | null | handlers/sr.py | flaviopicci/xen-backup | 306667f6ce3fd81d98b7a73312e37ad01f91c287 | [
"Apache-2.0"
] | null | null | null | handlers/sr.py | flaviopicci/xen-backup | 306667f6ce3fd81d98b7a73312e37ad01f91c287 | [
"Apache-2.0"
] | null | null | null | from handlers.common import Common
class SR(Common):
_type = "SR"
def __init__(self, xapi, ref=None, params=None):
super().__init__(xapi, ref, params)
| 18.888889 | 52 | 0.658824 | from handlers.common import Common
class SR(Common):
_type = "SR"
def __init__(self, xapi, ref=None, params=None):
super().__init__(xapi, ref, params)
| true | true |
f72b296dc9ecbc509d9451f3cf12c463f5785fef | 790 | py | Python | junk/pull_photos.py | simplegeo/betashapes | 25d964c6dc20281b8f4c0b9049cd417af3e21e35 | [
"PostgreSQL",
"Unlicense"
] | 14 | 2015-02-13T16:35:28.000Z | 2021-01-18T04:20:50.000Z | junk/pull_photos.py | simplegeo/betashapes | 25d964c6dc20281b8f4c0b9049cd417af3e21e35 | [
"PostgreSQL",
"Unlicense"
] | null | null | null | junk/pull_photos.py | simplegeo/betashapes | 25d964c6dc20281b8f4c0b9049cd417af3e21e35 | [
"PostgreSQL",
"Unlicense"
] | 1 | 2017-03-23T22:09:36.000Z | 2017-03-23T22:09:36.000Z | #!/usr/bin/python
import sys
import csv
#first arg: input file, csv. column woe_id should be the list of woe_ids we want to pull out of photos.txt
#second arg: output file, txt subset of photos.txt (also remove photoid. samplr not expecting it)
def main():
infile = sys.argv[1]
outfile = sys.argv[2]
phot... | 22.571429 | 106 | 0.605063 |
import sys
import csv
def main():
infile = sys.argv[1]
outfile = sys.argv[2]
photofile = "photos.txt"
woes = []
ireader = csv.DictReader(open(infile, 'r'))
for line in ireader:
woes.append(line['woe_id'])
pfh = open(photofile, 'r')
ofh = open(outfile, 'w')
outstr =... | true | true |
f72b29d93a56efc5fafb086551352e0cba9256da | 7,352 | py | Python | electrum/plugins/labels/labels.py | hodlwave/electrum | 52f8aafb604d05487a0612f65bacb966c0d0f569 | [
"MIT"
] | 4 | 2020-06-27T22:43:34.000Z | 2021-04-12T02:29:30.000Z | electrum/plugins/labels/labels.py | hodlwave/electrum | 52f8aafb604d05487a0612f65bacb966c0d0f569 | [
"MIT"
] | 21 | 2020-06-20T15:02:50.000Z | 2021-04-07T10:14:59.000Z | electrum/plugins/labels/labels.py | hodlwave/electrum | 52f8aafb604d05487a0612f65bacb966c0d0f569 | [
"MIT"
] | 13 | 2020-06-28T08:13:28.000Z | 2021-12-28T00:11:56.000Z | import asyncio
import hashlib
import json
import sys
import traceback
from typing import Union, TYPE_CHECKING
import base64
from electrum.plugin import BasePlugin, hook
from electrum.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv
from electrum.i18n import _
from electrum.util import log_exceptions, ignore_exc... | 37.896907 | 118 | 0.616159 | import asyncio
import hashlib
import json
import sys
import traceback
from typing import Union, TYPE_CHECKING
import base64
from electrum.plugin import BasePlugin, hook
from electrum.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv
from electrum.i18n import _
from electrum.util import log_exceptions, ignore_exc... | true | true |
f72b2ad2a58898693037001dda7e833ae44efbc4 | 682 | py | Python | pyntcloud/structures/kdtree.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/structures/kdtree.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/structures/kdtree.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | from scipy.spatial import cKDTree
from .base import Structure
class KDTree(cKDTree, Structure):
def __init__(self, *, points, leafsize=16, compact_nodes=False, balanced_tree=False):
Structure.__init__(self, points=points)
self._leafsize = leafsize
self._compact_nodes = compact_nodes
... | 31 | 96 | 0.66129 | from scipy.spatial import cKDTree
from .base import Structure
class KDTree(cKDTree, Structure):
def __init__(self, *, points, leafsize=16, compact_nodes=False, balanced_tree=False):
Structure.__init__(self, points=points)
self._leafsize = leafsize
self._compact_nodes = compact_nodes
... | true | true |
f72b2b40cbc83a0f7d47d5e52998f5659b19648e | 1,216 | py | Python | facemask.py | bhargavyagnik/FaceMaskDetection | 990c41a921a2a8a7760492a8dd21e4ab51391e51 | [
"MIT"
] | null | null | null | facemask.py | bhargavyagnik/FaceMaskDetection | 990c41a921a2a8a7760492a8dd21e4ab51391e51 | [
"MIT"
] | null | null | null | facemask.py | bhargavyagnik/FaceMaskDetection | 990c41a921a2a8a7760492a8dd21e4ab51391e51 | [
"MIT"
] | null | null | null | import tensorflow as tf
import cv2
import numpy as np
model = tf.keras.models.load_model('saved_model/model_3.h5')
face_clsfr = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
source = cv2.VideoCapture(1)
labels_dict = {0: 'with_mask', 1: 'without_mask'}
color_dict = {0: (0, 255, 0), 1: (0, 0,... | 30.4 | 75 | 0.578947 | import tensorflow as tf
import cv2
import numpy as np
model = tf.keras.models.load_model('saved_model/model_3.h5')
face_clsfr = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
source = cv2.VideoCapture(1)
labels_dict = {0: 'with_mask', 1: 'without_mask'}
color_dict = {0: (0, 255, 0), 1: (0, 0,... | true | true |
f72b2cd039ad9416819b474d149c3f6fbea635ff | 20,451 | py | Python | archive/canvas_test_6.py | bperez7/moments_models | d83e67b5d85f611ebf8dc10bc0d7569c962a37c2 | [
"BSD-2-Clause"
] | null | null | null | archive/canvas_test_6.py | bperez7/moments_models | d83e67b5d85f611ebf8dc10bc0d7569c962a37c2 | [
"BSD-2-Clause"
] | null | null | null | archive/canvas_test_6.py | bperez7/moments_models | d83e67b5d85f611ebf8dc10bc0d7569c962a37c2 | [
"BSD-2-Clause"
] | null | null | null | import cv2
import os
import time
import subprocess
#from matplotlib import pyplot as plt
import numpy as np
#from test_video import get_predictions_results
#cam_capture = cv2.VideoCapture(0)
#cv2.destroyAllWindows()
""" TODO:
1. Start video at specified time
2. Right click to indicate trimming points
3. Output file n... | 33.691928 | 156 | 0.509413 | import cv2
import os
import time
import subprocess
import numpy as np
frame_time = 10
frame_count = 0
global_trim_time = None
crop_started = False
class VideoCropTool:
def __init__(self, video_path, output_file, output_folder, video_start_time,
capture, output_label, time_window_on... | true | true |
f72b2cffb7796783443939305fa1035e7ad944b2 | 13,043 | py | Python | cltk/tests/test_nlp/test_tag.py | mcnorton05/cltk | 80dbbd6ee378ed4a6dd1723e4405e314b25f1638 | [
"MIT"
] | 1 | 2020-05-01T08:21:22.000Z | 2020-05-01T08:21:22.000Z | cltk/tests/test_nlp/test_tag.py | ecomp-shONgit/cltk | 7bc3ffd1bbbfa5d036297395d7e51b99b25b81ea | [
"MIT"
] | null | null | null | cltk/tests/test_nlp/test_tag.py | ecomp-shONgit/cltk | 7bc3ffd1bbbfa5d036297395d7e51b99b25b81ea | [
"MIT"
] | null | null | null | """Test cltk.tag."""
import os
import shutil
import unittest
from cltk.corpus.utils.importer import CorpusImporter
from cltk.stem.latin.j_v import JVReplacer
from cltk.tag import ner
from cltk.tag.ner import NamedEntityReplacer
from cltk.tag.pos import POSTag
__license__ = 'MIT License. See LICENSE.'
class TestSeq... | 47.952206 | 230 | 0.662501 |
import os
import shutil
import unittest
from cltk.corpus.utils.importer import CorpusImporter
from cltk.stem.latin.j_v import JVReplacer
from cltk.tag import ner
from cltk.tag.ner import NamedEntityReplacer
from cltk.tag.pos import POSTag
__license__ = 'MIT License. See LICENSE.'
class TestSequenceFunctions(unitte... | true | true |
f72b2f24626e265d01ae282b3f14a253aa950b3b | 307 | py | Python | src/dataleach/__init__.py | janies/dataleach | cf8c8784f3fe44cf8f89b7174ba36cb6c56d49d7 | [
"BSD-3-Clause"
] | 1 | 2021-11-08T13:57:52.000Z | 2021-11-08T13:57:52.000Z | src/dataleach/tests/dataleach/sources/__init__.py | janies/dataleach | cf8c8784f3fe44cf8f89b7174ba36cb6c56d49d7 | [
"BSD-3-Clause"
] | null | null | null | src/dataleach/tests/dataleach/sources/__init__.py | janies/dataleach | cf8c8784f3fe44cf8f89b7174ba36cb6c56d49d7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright © 2010, RedJack, LLC.
# All rights reserved.
#
# Please see the LICENSE.txt file in this distribution for license
# details.
# ----------------------------------------------------------------------
| 34.111111 | 72 | 0.361564 | true | true | |
f72b2fafee0e530b65dccaf38409dffa74760181 | 3,545 | py | Python | hddcoin/timelord/timelord_launcher.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | null | null | null | hddcoin/timelord/timelord_launcher.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | null | null | null | hddcoin/timelord/timelord_launcher.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import pathlib
import signal
import socket
import time
from typing import Dict, List
import pkg_resources
from hddcoin.util.hddcoin_logging import initialize_logging
from hddcoin.util.config import load_config
from hddcoin.util.default_root import DEFAULT_ROOT_PATH
from hddcoin.util.setp... | 30.560345 | 87 | 0.655289 | import asyncio
import logging
import pathlib
import signal
import socket
import time
from typing import Dict, List
import pkg_resources
from hddcoin.util.hddcoin_logging import initialize_logging
from hddcoin.util.config import load_config
from hddcoin.util.default_root import DEFAULT_ROOT_PATH
from hddcoin.util.setp... | true | true |
f72b3050bfccbe4c42d8488a0a707b9ddf77dbd2 | 485 | py | Python | scripts/venv/Scripts/easy_install-3.7-script.py | michaelfaerber/Agnos | b4b6ff9cdca9090fb426f1fc2cead8e5ef4ad9bf | [
"MIT"
] | null | null | null | scripts/venv/Scripts/easy_install-3.7-script.py | michaelfaerber/Agnos | b4b6ff9cdca9090fb426f1fc2cead8e5ef4ad9bf | [
"MIT"
] | 3 | 2021-12-10T01:22:05.000Z | 2021-12-14T21:33:16.000Z | scripts/venv/Scripts/easy_install-3.7-script.py | michaelfaerber/Agnos | b4b6ff9cdca9090fb426f1fc2cead8e5ef4ad9bf | [
"MIT"
] | null | null | null | #!K:\2018_SS\BMW_Thesis\workspace_bmw\Thesis_KG_Agnostic_EL\scripts\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[... | 37.307692 | 91 | 0.709278 |
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==39.1.0', 'console_scripts', 'easy_install-3.7')()
)
| true | true |
f72b30581d8ef30df8d3b88fde755c65a6390087 | 15,737 | py | Python | dssm/data_input.py | nlpming/tensorflow-DSMM | dc982cc49bf03f474da2895e4dd4fb37061c0271 | [
"MIT"
] | null | null | null | dssm/data_input.py | nlpming/tensorflow-DSMM | dc982cc49bf03f474da2895e4dd4fb37061c0271 | [
"MIT"
] | null | null | null | dssm/data_input.py | nlpming/tensorflow-DSMM | dc982cc49bf03f474da2895e4dd4fb37061c0271 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding=utf-8
from inspect import getblock
import json
import os
from os import read
from numpy.core.fromnumeric import mean
import numpy as np
import paddlehub as hub
import six
import math
import random
import sys
from util import read_file
from config import Config
# 配置文件
conf = Config()
c... | 37.20331 | 129 | 0.599797 |
from inspect import getblock
import json
import os
from os import read
from numpy.core.fromnumeric import mean
import numpy as np
import paddlehub as hub
import six
import math
import random
import sys
from util import read_file
from config import Config
conf = Config()
class Vocabulary(object):
def __init__(s... | true | true |
f72b319c6f56785827dd2160e2b9d041dde23ada | 5,281 | py | Python | experiments/ashvin/icml2020/hand/brac/test_video1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/brac/test_video1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/brac/test_video1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies im... | 30.883041 | 80 | 0.566938 |
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies import GaussianPolicy
from rlkit.torch.ne... | true | true |
f72b32a4095f35d7bed6ab5e19378d3c4f4d06be | 1,876 | py | Python | tests/test_airconditioning.py | izumi-system-arai/builelib | ae7c36df1ef7477e9a0356559b2694aabff11bb3 | [
"MIT"
] | 5 | 2020-09-04T13:56:45.000Z | 2022-03-06T05:46:55.000Z | tests/test_airconditioning.py | izumi-system-arai/builelib | ae7c36df1ef7477e9a0356559b2694aabff11bb3 | [
"MIT"
] | 1 | 2021-08-17T07:11:42.000Z | 2021-08-17T07:11:42.000Z | tests/test_airconditioning.py | izumi-system-arai/builelib | ae7c36df1ef7477e9a0356559b2694aabff11bb3 | [
"MIT"
] | 2 | 2021-07-06T09:41:20.000Z | 2021-08-02T08:47:13.000Z | import pandas as pd
import csv
from builelib import airconditioning
import pytest
import json
import xlrd
### テストファイル名 ###
# 辞書型 テスト名とファイル名
testcase_dict = {
"AHU_basic": "./tests/airconditioning/★空調設備テストケース一覧.xlsx",
}
def convert2number(x, default):
'''
空欄にデフォルト値を代入する
'''
if x == "":
x ... | 21.563218 | 92 | 0.647122 | import pandas as pd
import csv
from builelib import airconditioning
import pytest
import json
import xlrd
": "./tests/airconditioning/★空調設備テストケース一覧.xlsx",
}
def convert2number(x, default):
if x == "":
x = default
else:
x = float(x)
return x
def read_testcasefile(filename):
wb = xlrd... | true | true |
f72b338ae3488cd29a445fe80006558b89a53eb0 | 3,209 | py | Python | API/moviepiapi/utils.py | theoarmengou/MoviePi | b889ed1609e3db096b86452e3ca608822edcdb1a | [
"MIT"
] | 1 | 2020-01-08T12:09:14.000Z | 2020-01-08T12:09:14.000Z | API/moviepiapi/utils.py | theoarmengou/MoviePi | b889ed1609e3db096b86452e3ca608822edcdb1a | [
"MIT"
] | null | null | null | API/moviepiapi/utils.py | theoarmengou/MoviePi | b889ed1609e3db096b86452e3ca608822edcdb1a | [
"MIT"
] | 1 | 2020-10-30T10:33:19.000Z | 2020-10-30T10:33:19.000Z | ##
# EPITECH PROJECT, 2019
# MoviePi
# File description:
# utils.py
##
import datetime
import jwt
from moviepiapi.dbHelper import dbHelper
from moviepiapi.userHelper import userHelper
ret_packet = {'responseStatus': 0, 'message': "", 'data': any}
Key = 'MoviePiTheoAudreyHicham'
LEN_MAX_USER = 255
db = dbHelper('movi... | 30.561905 | 100 | 0.621377 |
import datetime
import jwt
from moviepiapi.dbHelper import dbHelper
from moviepiapi.userHelper import userHelper
ret_packet = {'responseStatus': 0, 'message': "", 'data': any}
Key = 'MoviePiTheoAudreyHicham'
LEN_MAX_USER = 255
db = dbHelper('moviepi_api', 'moviepi_api', 'moviepi', '51.75.141.254')
userH = userHe... | true | true |
f72b33a87fd87b89f914f36a973b364e5a397d6d | 471 | py | Python | basics/src/simple_action_client.py | jescasany/rosbook | a79258e7fa80eb4f8745850125d6b2e462a62dee | [
"Apache-2.0"
] | null | null | null | basics/src/simple_action_client.py | jescasany/rosbook | a79258e7fa80eb4f8745850125d6b2e462a62dee | [
"Apache-2.0"
] | null | null | null | basics/src/simple_action_client.py | jescasany/rosbook | a79258e7fa80eb4f8745850125d6b2e462a62dee | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import roslib; roslib.load_manifest('basics')
import rospy
import actionlib
from basics.msg import TimerAction, TimerGoal, TimerResult
rospy.init_node('timer_action_client')
client = actionlib.SimpleActionClient('timer', TimerAction)
client.wait_for_server()
goal = TimerGoal()
goal.time_to_wait... | 27.705882 | 69 | 0.794055 |
import roslib; roslib.load_manifest('basics')
import rospy
import actionlib
from basics.msg import TimerAction, TimerGoal, TimerResult
rospy.init_node('timer_action_client')
client = actionlib.SimpleActionClient('timer', TimerAction)
client.wait_for_server()
goal = TimerGoal()
goal.time_to_wait = rospy.Duration.from... | true | true |
f72b34ac6ea7004cf31e6dccd1805b12ef0d95bf | 2,106 | py | Python | gmprocess/waveform_processing/clipping/clipping_check.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | null | null | null | gmprocess/waveform_processing/clipping/clipping_check.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | null | null | null | gmprocess/waveform_processing/clipping/clipping_check.py | baagaard-usgs/groundmotion-processing | 6be2b4460d598bba0935135efa85af2655578565 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from obspy.geodetics.base import gps2dist_azimuth
from gmprocess.waveform_processing.clipping.clipping_ann import clipNet
from gmprocess.waveform_processing.clipping.max_amp import Max_Amp
from gmprocess.waveform_processing.clipping.histogram import Hi... | 26.658228 | 79 | 0.646724 |
import numpy as np
from obspy.geodetics.base import gps2dist_azimuth
from gmprocess.waveform_processing.clipping.clipping_ann import clipNet
from gmprocess.waveform_processing.clipping.max_amp import Max_Amp
from gmprocess.waveform_processing.clipping.histogram import Histogram
from gmprocess.waveform_processing.c... | true | true |
f72b35700339e44cd46bed837a41ec9eb436c1cc | 12,143 | py | Python | Lab0/Example3/top_block.py | RadiumScriptTang/Wireless-communication-systems-Lab | 37afc4e3cc9fa8759b22ec2737b747d2628e01df | [
"MIT"
] | 47 | 2019-08-01T12:24:20.000Z | 2022-03-22T14:21:54.000Z | Lab0/Example3/top_block.py | aboulogeorgos/Wireless-communication-systems-Lab | 37afc4e3cc9fa8759b22ec2737b747d2628e01df | [
"MIT"
] | null | null | null | Lab0/Example3/top_block.py | aboulogeorgos/Wireless-communication-systems-Lab | 37afc4e3cc9fa8759b22ec2737b747d2628e01df | [
"MIT"
] | 13 | 2020-03-04T20:20:10.000Z | 2022-02-23T14:22:02.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Combination of two signal sources
# Author: Alexandros-Apostolos A. Boulogeorgos
# Generated: Tue Nov 5 13:35:41 2019
##################################################
if __name__ ... | 43.060284 | 169 | 0.612781 |
i]) == 0:
if(i % 2 == 0):
self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2))
else:
self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2))
else:
self.qtgui_time_sink_x_0.set_line_... | false | true |
f72b36d5fb0cf98eeb2d459b179cfde55b038f13 | 2,311 | py | Python | model.py | bhardwajRahul/RestaurantAPI | 28d7fcd3fbe0524750321102625d8475515f54ed | [
"MIT"
] | 15 | 2018-06-03T16:35:16.000Z | 2022-02-13T16:36:37.000Z | model.py | bhardwajRahul/RestaurantAPI | 28d7fcd3fbe0524750321102625d8475515f54ed | [
"MIT"
] | 2 | 2019-02-11T07:03:09.000Z | 2021-02-25T09:16:15.000Z | model.py | navi25/RestaurantAPI | 28d7fcd3fbe0524750321102625d8475515f54ed | [
"MIT"
] | 9 | 2019-02-08T11:17:34.000Z | 2022-01-29T00:27:14.000Z | from flask import Flask
from marshmallow import Schema, fields, pre_load, validate
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
ma = Marshmallow()
db = SQLAlchemy()
redis_cache = FlaskRedis()
class FoodModel(db.Model):
__tablename__ = 'foods'... | 35.553846 | 110 | 0.719169 | from flask import Flask
from marshmallow import Schema, fields, pre_load, validate
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
ma = Marshmallow()
db = SQLAlchemy()
redis_cache = FlaskRedis()
class FoodModel(db.Model):
__tablename__ = 'foods'... | true | true |
f72b36f1c01c85d1f6f16819bc764c32780c7fb6 | 22,006 | py | Python | sdk/python/pulumi_azure_native/databoxedge/v20200501preview/share.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200501preview/share.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/databoxedge/v20200501preview/share.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 48.578366 | 1,294 | 0.668045 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['ShareArgs', 'Share']
@pulumi.input_type
class ShareArgs:
def __init__(__self__, *,
... | true | true |
f72b36f52912edb8de8bb2207281239f45df89b6 | 2,134 | py | Python | demo/orm.py | 1987539447/start-python | 06ee5eb30e7395cd8432e8e33d7209fa855f4ad9 | [
"Apache-2.0"
] | null | null | null | demo/orm.py | 1987539447/start-python | 06ee5eb30e7395cd8432e8e33d7209fa855f4ad9 | [
"Apache-2.0"
] | null | null | null | demo/orm.py | 1987539447/start-python | 06ee5eb30e7395cd8432e8e33d7209fa855f4ad9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# FileName:orm.py
# -*- coding: utf-8 -*-
""" 通过元类实现简单的ORM框剪 """
class Field(object):
def __init__(self, name, column_type):
self.name = name
self.column_type = column_type
def __str__(self):
return '<%s:%s>' % (self.__class__.__name__, self.name)
class Intege... | 27.012658 | 101 | 0.56701 |
class Field(object):
def __init__(self, name, column_type):
self.name = name
self.column_type = column_type
def __str__(self):
return '<%s:%s>' % (self.__class__.__name__, self.name)
class IntegerField(Field):
def __init__(self, name):
super(IntegerField, self).__init... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.