hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f772016b8602c0dbd1d7ecb377f4bfbebe6c98fa | 2,568 | py | Python | relays.def.py | fazalfarhan01/alpha | efd85a3d2a7aac3247855d3c590de28a57fa03eb | [
"Unlicense"
] | null | null | null | relays.def.py | fazalfarhan01/alpha | efd85a3d2a7aac3247855d3c590de28a57fa03eb | [
"Unlicense"
] | null | null | null | relays.def.py | fazalfarhan01/alpha | efd85a3d2a7aac3247855d3c590de28a57fa03eb | [
"Unlicense"
] | null | null | null | """
'relay4_out.py'
===================================
Example of turning on and off a LED
from the Adafruit IO Python Client
Author(s): Brent Rubell, Todd Treece
"""
# Import standard python modules
import time
# import Adafruit Blinka
import digitalio
import board
# import Adafruit IO REST client.
from Adafruit_IO... | 29.517241 | 61 | 0.671729 | import time
import digitalio
import board
from Adafruit_IO import Client, Feed, RequestError
ADAFRUIT_IO_KEY = '34e4ad43c9ef4cb08402e2a8e44f6912'
ADAFRUIT_IO_USERNAME = 'farhanf1'
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
try:
Arelay = aio.feeds('relay1')
Brelay = aio.feeds('relay2')
Cre... | true | true |
f77202b122e462b847a0e7d36f521a8f3b4f5d1b | 372 | py | Python | exercicios/Curso_em_video_MUNDO2_incompleto/desafio41.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | exercicios/Curso_em_video_MUNDO2_incompleto/desafio41.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | exercicios/Curso_em_video_MUNDO2_incompleto/desafio41.py | IgoPereiraBarros/maratona-data-science-brasil | cc07476579134a2764f00d229d415657555dcdd1 | [
"MIT"
] | null | null | null | from datetime import date as d
ano_nascimento = int(input('Informe o ano de nascimento: '))
atual = d.today().year
idade = atual - ano_nascimento
print('O atleta tem {} anos'.format(idade))
if idade <= 9:
print('Mirin')
elif idade <= 14:
print('Infantil')
elif idade <= 19:
print('Júnior')
elif idade <= 2... | 16.909091 | 60 | 0.645161 | from datetime import date as d
ano_nascimento = int(input('Informe o ano de nascimento: '))
atual = d.today().year
idade = atual - ano_nascimento
print('O atleta tem {} anos'.format(idade))
if idade <= 9:
print('Mirin')
elif idade <= 14:
print('Infantil')
elif idade <= 19:
print('Júnior')
elif idade <= 2... | true | true |
f772039ed9caf8004123799fe3816f9259feaa56 | 1,307 | py | Python | simple_tensorflow_serving/gen_client/gen_bash.py | jnclt/simple_tensorflow_serving | 61c7227c8c9c77ae08cf7baa1e315036edd65e7a | [
"Apache-2.0"
] | 771 | 2018-01-23T07:15:53.000Z | 2022-03-21T07:32:19.000Z | simple_tensorflow_serving/gen_client/gen_bash.py | jnclt/simple_tensorflow_serving | 61c7227c8c9c77ae08cf7baa1e315036edd65e7a | [
"Apache-2.0"
] | 90 | 2018-01-24T13:53:24.000Z | 2021-07-23T02:45:13.000Z | simple_tensorflow_serving/gen_client/gen_bash.py | jnclt/simple_tensorflow_serving | 61c7227c8c9c77ae08cf7baa1e315036edd65e7a | [
"Apache-2.0"
] | 211 | 2018-01-25T13:37:40.000Z | 2022-03-30T19:49:39.000Z |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
from jinja2 import Template
def gen_tensorflow_client_string(generated_tensor_data, model_name):
"""
Generate TensorFlow SDK in Bash.
Args:
generated_tensor_data: Examp... | 29.704545 | 138 | 0.731446 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
from jinja2 import Template
def gen_tensorflow_client_string(generated_tensor_data, model_name):
code_template = """#!/bin/bash
curl -H "Content-Type: application/json" -X POS... | true | true |
f77203cc3851955121ced462b29f1f3ec7db6b09 | 1,578 | py | Python | app/user/api/views.py | HSAkash/Questionnaire_api | 95a0e4e7bc680fe27dd312dad0e2fd70ceafb8b4 | [
"MIT"
] | 1 | 2021-12-26T06:18:48.000Z | 2021-12-26T06:18:48.000Z | app/user/api/views.py | HSAkash/Questionnaire_api | 95a0e4e7bc680fe27dd312dad0e2fd70ceafb8b4 | [
"MIT"
] | null | null | null | app/user/api/views.py | HSAkash/Questionnaire_api | 95a0e4e7bc680fe27dd312dad0e2fd70ceafb8b4 | [
"MIT"
] | null | null | null | """rest freamwork import"""
from . import serializers
from rest_framework import status
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework.response import Response
from rest_framework import (
generics,
pe... | 28.690909 | 74 | 0.722433 | from . import serializers
from rest_framework import status
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework.response import Response
from rest_framework import (
generics,
permissions,
status,
)
c... | true | true |
f77204156c832f238e4fa125cb578eac09389826 | 2,948 | py | Python | config/startup/calendar_events.py | NatKarmios/DebainCfg | ca6fb8429c1b1c97f540982f661ce605c0e5d520 | [
"WTFPL"
] | null | null | null | config/startup/calendar_events.py | NatKarmios/DebainCfg | ca6fb8429c1b1c97f540982f661ce605c0e5d520 | [
"WTFPL"
] | null | null | null | config/startup/calendar_events.py | NatKarmios/DebainCfg | ca6fb8429c1b1c97f540982f661ce605c0e5d520 | [
"WTFPL"
] | null | null | null | import pyrfc3339
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import datetime
def ordinal(n):
return "%d%s" % (n,"tsnrhtdd"[(n/10%10!=1)*(n%10<4)*n%10::4])
try:
import argparse
flags = argp... | 32.755556 | 97 | 0.675373 | import pyrfc3339
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import datetime
def ordinal(n):
return "%d%s" % (n,"tsnrhtdd"[(n/10%10!=1)*(n%10<4)*n%10::4])
try:
import argparse
flags = argp... | true | true |
f7720435edc9a186c6da2b3ce7e7e742f13a94c9 | 2,027 | py | Python | app.py | applepassion4/SQLAlchemy | 2e06a068fea3cef979067e569b7e46811d099a51 | [
"ADSL"
] | null | null | null | app.py | applepassion4/SQLAlchemy | 2e06a068fea3cef979067e569b7e46811d099a51 | [
"ADSL"
] | null | null | null | app.py | applepassion4/SQLAlchemy | 2e06a068fea3cef979067e569b7e46811d099a51 | [
"ADSL"
] | null | null | null | import pandas as pd
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import flask
from flask import Flask , jsonify
engine = create_engine("sqlite:///hawaii.sqlite")
Base = aut... | 14.904412 | 104 | 0.594968 | import pandas as pd
import numpy as np
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import flask
from flask import Flask , jsonify
engine = create_engine("sqlite:///hawaii.sqlite")
Base = aut... | false | true |
f772047ec114f27c7c07d8c0c89f2ea48d0b34e3 | 462 | py | Python | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_belt_s03.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_belt_s03.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_belt_s03.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/ithorian/shared_ith_belt_s03.iff"
result.attribute_templa... | 27.176471 | 79 | 0.735931 |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/ithorian/shared_ith_belt_s03.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","ith_belt_s03")
return result | true | true |
f7720570a4e32dfbe3bc5682681551886e1bff2c | 1,196 | py | Python | tests/test_utils.py | dveselov/termformat | cb281fb25942758e0b10b5470f9ce5f3bb5e1413 | [
"MIT"
] | 1 | 2016-07-25T22:43:24.000Z | 2016-07-25T22:43:24.000Z | tests/test_utils.py | dveselov/termformat | cb281fb25942758e0b10b5470f9ce5f3bb5e1413 | [
"MIT"
] | null | null | null | tests/test_utils.py | dveselov/termformat | cb281fb25942758e0b10b5470f9ce5f3bb5e1413 | [
"MIT"
] | null | null | null | import termformat
from unittest import TestCase
class UtilsTestCase(TestCase):
def test_is_valid_atom(self):
self.assertTrue(termformat.is_atom(":foo"))
self.assertTrue(termformat.is_atom(u":foo"))
self.assertTrue(termformat.is_atom(":Bar"))
def test_is_invalid_atom(self):
self.assertFalse(termf... | 32.324324 | 58 | 0.73913 | import termformat
from unittest import TestCase
class UtilsTestCase(TestCase):
def test_is_valid_atom(self):
self.assertTrue(termformat.is_atom(":foo"))
self.assertTrue(termformat.is_atom(u":foo"))
self.assertTrue(termformat.is_atom(":Bar"))
def test_is_invalid_atom(self):
self.assertFalse(termf... | true | true |
f77206310d3b158d166e71557b79f01b3288c533 | 3,437 | py | Python | Extra Scripts/shapeAnalysisEccentricity.py | saw-mill/HawkEyeSquash | 2259923cf4407e259aa684995a642e8145efafe3 | [
"Apache-2.0"
] | 5 | 2019-08-15T16:51:18.000Z | 2022-03-23T11:27:26.000Z | Extra Scripts/shapeAnalysisEccentricity.py | saw-mill/HawkEyeSquash | 2259923cf4407e259aa684995a642e8145efafe3 | [
"Apache-2.0"
] | null | null | null | Extra Scripts/shapeAnalysisEccentricity.py | saw-mill/HawkEyeSquash | 2259923cf4407e259aa684995a642e8145efafe3 | [
"Apache-2.0"
] | 1 | 2022-01-05T21:48:16.000Z | 2022-01-05T21:48:16.000Z | import glob
import time
import cv2
from scipy.spatial import distance
import math
from foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort
from ballDetection import filterSize, drawRectangle
startTimeReadingFrames = time.time()
# Location of dataset
filenames = glob.glob("D... | 33.696078 | 136 | 0.661042 | import glob
import time
import cv2
from scipy.spatial import distance
import math
from foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort
from ballDetection import filterSize, drawRectangle
startTimeReadingFrames = time.time()
filenames = glob.glob("Dataset2/*.jpg")
frame... | true | true |
f77206aadcbd5ded4eaf2bc443172ce5b0901fd2 | 2,911 | py | Python | yt_mod_1.py | 1MochaChan1/pafy | fa071353f7f59ef60c279f6a89d45b6b9c9343c5 | [
"MIT"
] | null | null | null | yt_mod_1.py | 1MochaChan1/pafy | fa071353f7f59ef60c279f6a89d45b6b9c9343c5 | [
"MIT"
] | null | null | null | yt_mod_1.py | 1MochaChan1/pafy | fa071353f7f59ef60c279f6a89d45b6b9c9343c5 | [
"MIT"
] | null | null | null | import requests
import json
import re
from bs4 import BeautifulSoup
def search_content(query):
search = "https://www.youtube.com/results?search_query="
text = query
text = list(text.split(" "))
search_query = f"{search}{'+'.join(str(x) for x in text)}"
source = requests.get(search_que... | 40.430556 | 166 | 0.454483 | import requests
import json
import re
from bs4 import BeautifulSoup
def search_content(query):
search = "https://www.youtube.com/results?search_query="
text = query
text = list(text.split(" "))
search_query = f"{search}{'+'.join(str(x) for x in text)}"
source = requests.get(search_que... | true | true |
f77207290d4b78519e9e4ce1b5d746f1f362d870 | 3,117 | py | Python | scripts/nanopolish_merge.py | mr-c/nanopolish | 5d6fa83be9775ad1c0dd07fa55a9705c12fdba91 | [
"MIT"
] | 2 | 2020-07-01T14:05:06.000Z | 2021-09-26T10:38:37.000Z | scripts/nanopolish_merge.py | mr-c/nanopolish | 5d6fa83be9775ad1c0dd07fa55a9705c12fdba91 | [
"MIT"
] | null | null | null | scripts/nanopolish_merge.py | mr-c/nanopolish | 5d6fa83be9775ad1c0dd07fa55a9705c12fdba91 | [
"MIT"
] | 1 | 2021-05-04T07:54:32.000Z | 2021-05-04T07:54:32.000Z |
import sys
import glob
from Bio.SeqIO.FastaIO import SimpleFastaParser
from Bio import pairwise2
def merge_into_consensus(consensus, incoming, overlap_length):
# if first segment, no overlapping needs to be done
if consensus == "":
return incoming
or_con = consensus[-overlap_length:]
or_inc... | 29.40566 | 129 | 0.649984 |
import sys
import glob
from Bio.SeqIO.FastaIO import SimpleFastaParser
from Bio import pairwise2
def merge_into_consensus(consensus, incoming, overlap_length):
if consensus == "":
return incoming
or_con = consensus[-overlap_length:]
or_inc = incoming[0:overlap_length]
alignment... | true | true |
f77207776a4fce58a5689b37fbe8c33dce513d6b | 1,543 | py | Python | warehouse/accounts/forms.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"Apache-2.0"
] | 1 | 2019-06-19T19:58:49.000Z | 2019-06-19T19:58:49.000Z | warehouse/accounts/forms.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"Apache-2.0"
] | null | null | null | warehouse/accounts/forms.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"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 the Li... | 31.489796 | 77 | 0.686973 |
import wtforms
from warehouse import forms
class LoginForm(forms.Form):
username = wtforms.StringField(
validators=[
wtforms.validators.DataRequired(),
wtforms.validators.Length(max=50),
],
)
password = wtforms.PasswordField(
validators=[
wtf... | true | true |
f77207d5fd5b0766fd8be88d72dd24d0b4a0f7ef | 3,240 | py | Python | tests/models/self_supervised/test_scripts.py | hecoding/pytorch-lightning-bolts | 4d254fde6112b21436003028d553a726bf7ea6ef | [
"Apache-2.0"
] | null | null | null | tests/models/self_supervised/test_scripts.py | hecoding/pytorch-lightning-bolts | 4d254fde6112b21436003028d553a726bf7ea6ef | [
"Apache-2.0"
] | null | null | null | tests/models/self_supervised/test_scripts.py | hecoding/pytorch-lightning-bolts | 4d254fde6112b21436003028d553a726bf7ea6ef | [
"Apache-2.0"
] | null | null | null | from unittest import mock
import pytest
import torch
from tests import DATASETS_PATH
@pytest.mark.parametrize('cli_args', [
f"--data_dir {DATASETS_PATH} --max_epochs 1 --max_steps 3 --fast_dev_run --batch_size 2"
])
def test_cli_run_self_supervised_amdim(cli_args):
"""Test running CLI for an example with de... | 38.571429 | 115 | 0.712346 | from unittest import mock
import pytest
import torch
from tests import DATASETS_PATH
@pytest.mark.parametrize('cli_args', [
f"--data_dir {DATASETS_PATH} --max_epochs 1 --max_steps 3 --fast_dev_run --batch_size 2"
])
def test_cli_run_self_supervised_amdim(cli_args):
from pl_bolts.models.self_supervised.amdim... | true | true |
f77208bcd73c61a7a3ce5fd2fdafabad62ffa99c | 10,176 | py | Python | python/helpers/pydev/_pydevd_bundle/pydevd_bytecode_utils.py | CeH9/intellij-community | ae45cfd4c76876f9b1c58c6f46508d18523ebd41 | [
"Apache-2.0"
] | 1 | 2020-05-30T04:49:44.000Z | 2020-05-30T04:49:44.000Z | python/helpers/pydev/_pydevd_bundle/pydevd_bytecode_utils.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/helpers/pydev/_pydevd_bundle/pydevd_bytecode_utils.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | """Bytecode analysing utils. Originally added for using in smart step into."""
import dis
import inspect
from collections import namedtuple
from _pydevd_bundle.pydevd_constants import IS_PY3K, IS_CPYTHON
__all__ = ["get_smart_step_into_candidates"]
_LOAD_OPNAMES = {
'LOAD_BUILD_CLASS',
'LOAD_CONST',
'LOA... | 34.033445 | 136 | 0.600236 | import dis
import inspect
from collections import namedtuple
from _pydevd_bundle.pydevd_constants import IS_PY3K, IS_CPYTHON
__all__ = ["get_smart_step_into_candidates"]
_LOAD_OPNAMES = {
'LOAD_BUILD_CLASS',
'LOAD_CONST',
'LOAD_NAME',
'LOAD_ATTR',
'LOAD_GLOBAL',
'LOAD_FAST',
'LOAD_CLOSURE... | true | true |
f772091bfc20eea099c9261db65bb2c22f92a8eb | 284 | py | Python | config.py | HeatzRM/AgriChain | d27cd45fd8fe2b8e8bba3b0dfeae545343c29f25 | [
"MIT"
] | null | null | null | config.py | HeatzRM/AgriChain | d27cd45fd8fe2b8e8bba3b0dfeae545343c29f25 | [
"MIT"
] | 1 | 2018-09-16T03:37:55.000Z | 2018-09-16T03:38:52.000Z | config.py | HeatzRM/AgriChain | d27cd45fd8fe2b8e8bba3b0dfeae545343c29f25 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('heatz') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:myhome@localhost/theology_library'
SQLALCHEMY_TRACK_MODIFICATIONS = False
| 35.5 | 87 | 0.771127 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('heatz') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:myhome@localhost/theology_library'
SQLALCHEMY_TRACK_MODIFICATIONS = False
| true | true |
f7720c0eb28b25f44cc808c86f61c7a125283ebf | 1,419 | py | Python | apps/accounts/models/phone_device.py | victoraguilarc/agendas | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 2 | 2020-06-06T23:10:27.000Z | 2020-10-06T19:12:26.000Z | apps/accounts/models/phone_device.py | victoraguilarc/medical-appointment | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 3 | 2021-04-08T20:44:38.000Z | 2021-09-22T19:04:16.000Z | apps/accounts/models/phone_device.py | victoraguilarc/agendas | 31b24a2d6350605b638b59062f297ef3f58e9879 | [
"MIT"
] | 1 | 2020-10-10T14:07:37.000Z | 2020-10-10T14:07:37.000Z | # -*- coding: utf-8 -*-
from django.db import models
from apps.accounts.models.choices import Platform
from apps.accounts.models.managers.phone_device import PhoneDeviceManager
from django.utils.translation import ugettext_lazy as _
from apps.contrib.models.mixins import UUIDPrimaryKeyModelMixin, TimeStampedModelM... | 22.887097 | 86 | 0.626498 |
from django.db import models
from apps.accounts.models.choices import Platform
from apps.accounts.models.managers.phone_device import PhoneDeviceManager
from django.utils.translation import ugettext_lazy as _
from apps.contrib.models.mixins import UUIDPrimaryKeyModelMixin, TimeStampedModelMixin
class PhoneDevice... | true | true |
f7720ef1532ea52c399be32a3a0fca40de58b206 | 106 | py | Python | win_max_path_error/example.py | stefano-m/pip_issue_2892 | d7a6d85218d913237432fb44b0d8acf84dc4ab9c | [
"Unlicense"
] | null | null | null | win_max_path_error/example.py | stefano-m/pip_issue_2892 | d7a6d85218d913237432fb44b0d8acf84dc4ab9c | [
"Unlicense"
] | null | null | null | win_max_path_error/example.py | stefano-m/pip_issue_2892 | d7a6d85218d913237432fb44b0d8acf84dc4ab9c | [
"Unlicense"
] | null | null | null | def adder(y):
def addsome(x):
return x +y
return addsome
add1 = adder(1)
add2 = adder(2)
| 13.25 | 19 | 0.575472 | def adder(y):
def addsome(x):
return x +y
return addsome
add1 = adder(1)
add2 = adder(2)
| true | true |
f772106915f137b2da3a97ef2753f34117d8135f | 3,847 | py | Python | docs/source/conf.py | grohith327/EasyGAN | cbbff0283eda08f2d056215574f798e976d3ece0 | [
"MIT"
] | 23 | 2020-03-10T16:16:34.000Z | 2022-01-09T11:04:21.000Z | docs/source/conf.py | grohith327/EasyGAN | cbbff0283eda08f2d056215574f798e976d3ece0 | [
"MIT"
] | 3 | 2020-03-09T01:43:45.000Z | 2020-05-19T14:52:28.000Z | docs/source/conf.py | grohith327/EasyGAN | cbbff0283eda08f2d056215574f798e976d3ece0 | [
"MIT"
] | 1 | 2020-05-19T15:22:39.000Z | 2020-05-19T15:22:39.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.745614 | 85 | 0.647258 |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
project = 'SimpleGAN'
copyright = '2020, Rohith Gandhi G'
author = 'Rohith Gandhi G'
release = 'v0.2.8'
autodoc_mock_imports = ["cv2",
"tensorflow",
"tenso... | true | true |
f772107ef7c3d8f70cfaa62f662c0864788fad5e | 664 | py | Python | buildpackage/utils.py | sfdcale/packagebuilder | 386ac15385136786b143ae9dc54b6e21b354a78c | [
"MIT"
] | 97 | 2015-03-04T20:07:43.000Z | 2022-01-21T21:29:13.000Z | buildpackage/utils.py | sfdcale/packagebuilder | 386ac15385136786b143ae9dc54b6e21b354a78c | [
"MIT"
] | 26 | 2017-01-04T14:05:56.000Z | 2021-12-13T19:42:06.000Z | buildpackage/utils.py | saivinayabsyz/SalesforceCloneOrg | 8e6b1e2e8c4d087b6777326dd619248a443814a3 | [
"MIT"
] | 92 | 2015-01-27T22:14:51.000Z | 2021-09-24T14:06:10.000Z | from django.conf import settings
import requests
def get_headers(access_token):
"""
Build the headers for each authorised request
"""
return {
'Authorization': 'Bearer %s' % access_token,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
def get_user_with... | 25.538462 | 79 | 0.668675 | from django.conf import settings
import requests
def get_headers(access_token):
return {
'Authorization': 'Bearer %s' % access_token,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
def get_user_with_no_id(instance_url, access_token):
url = '%s%schatter/use... | true | true |
f772123bb348e2da0ee2ac220aae74bef27cd535 | 1,959 | py | Python | airflow/providers/vertica/operators/vertica.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | 1 | 2021-11-22T20:21:14.000Z | 2021-11-22T20:21:14.000Z | airflow/providers/vertica/operators/vertica.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"Apache-2.0"
] | null | null | null | airflow/providers/vertica/operators/vertica.py | takuti/airflow | 0ac3b8c3dd749c59e60cf0169580b9e7c5049d9e | [
"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 not... | 37.673077 | 100 | 0.718224 | from typing import TYPE_CHECKING, Any, List, Sequence, Union
from airflow.models import BaseOperator
from airflow.providers.vertica.hooks.vertica import VerticaHook
if TYPE_CHECKING:
from airflow.utils.context import Context
class VerticaOperator(BaseOperator):
template_fields: Sequence[str] = ('sql',)
... | true | true |
f77212895441b0563b7b2f5c3d5f64414529298f | 2,756 | py | Python | insta/models.py | devseme/Instagram | c7dd322a407ab48f71c5b724fadeacd313385fb3 | [
"MIT"
] | null | null | null | insta/models.py | devseme/Instagram | c7dd322a407ab48f71c5b724fadeacd313385fb3 | [
"MIT"
] | null | null | null | insta/models.py | devseme/Instagram | c7dd322a407ab48f71c5b724fadeacd313385fb3 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_photo = CloudinaryField('image')
bio = models.TextField(max_leng... | 25.757009 | 93 | 0.664731 | from django.db import models
from django.contrib.auth.models import User
from cloudinary.models import CloudinaryField
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
profile_photo = CloudinaryField('image')
bio = models.TextField(max_length=500, blank=True, null=Tr... | true | true |
f7721366c17c0132f40f6599ae02f77abfd7cfb4 | 13,119 | py | Python | example/rcnn/rcnn/symbol/symbol_resnet.py | xudong-sun/mxnet | fe42d30d5885dd576cb871fd70594c53efce9b42 | [
"Apache-2.0"
] | 116 | 2018-01-01T03:53:49.000Z | 2021-09-06T07:09:09.000Z | example/rcnn/rcnn/symbol/symbol_resnet.py | greenpea0104/incubator-mxnet | fc9e70bf2d349ad4c6cb65ff3f0958e23a7410bf | [
"Apache-2.0"
] | 23 | 2018-06-11T20:03:54.000Z | 2018-08-10T03:17:49.000Z | example/rcnn/rcnn/symbol/symbol_resnet.py | greenpea0104/incubator-mxnet | fc9e70bf2d349ad4c6cb65ff3f0958e23a7410bf | [
"Apache-2.0"
] | 47 | 2016-04-19T22:46:09.000Z | 2020-09-30T08:09:16.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 57.03913 | 133 | 0.700511 |
import mxnet as mx
from rcnn.config import config
from . import proposal
from . import proposal_target
eps = 2e-5
use_global_stats = True
workspace = 512
res_deps = {'50': (3, 4, 6, 3), '101': (3, 4, 23, 3), '152': (3, 8, 36, 3), '200': (3, 24, 36, 3)}
units = res_deps['101']
filter_list = [256, 512, 1024, 2048]
de... | true | true |
f77213c5f49869d313e1dfb2f1803057e624fc65 | 28,231 | py | Python | craftui/craftui.py | DentonGentry/gfiber-platform | 2ba5266103aad0b7b676555eebd3c2061ddb8333 | [
"Apache-2.0"
] | 8 | 2017-09-24T03:11:46.000Z | 2021-08-24T04:29:14.000Z | craftui/craftui.py | DentonGentry/gfiber-platform | 2ba5266103aad0b7b676555eebd3c2061ddb8333 | [
"Apache-2.0"
] | null | null | null | craftui/craftui.py | DentonGentry/gfiber-platform | 2ba5266103aad0b7b676555eebd3c2061ddb8333 | [
"Apache-2.0"
] | 1 | 2017-10-05T23:04:10.000Z | 2017-10-05T23:04:10.000Z | #! /usr/bin/python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 29.407292 | 80 | 0.606071 |
"""Chimera craft UI. Code lifted from catawampus diag and tech UI."""
__author__ = 'edjames@google.com (Ed James)'
import base64
import getopt
import json
import os
import re
import StringIO
import subprocess
import sys
import urllib2
import digest
import png
import tornado.httpserver
import tornado.ioloop
import t... | false | true |
f77213c7289f01d0248c3bcbec3bd84d959c7a97 | 157 | py | Python | tests/__init__.py | pawamoy/duty | dac90183543b73fdd6e5fab354a56c5484d5762a | [
"0BSD"
] | 25 | 2020-10-09T08:46:12.000Z | 2022-03-16T18:58:39.000Z | tests/__init__.py | pawamoy/duty | dac90183543b73fdd6e5fab354a56c5484d5762a | [
"0BSD"
] | 4 | 2020-11-12T19:27:41.000Z | 2021-08-01T13:24:31.000Z | tests/__init__.py | pawamoy/duty | dac90183543b73fdd6e5fab354a56c5484d5762a | [
"0BSD"
] | null | null | null | """Tests suite for `duty`."""
from pathlib import Path
TESTS_DIR = Path(__file__).parent
TMP_DIR = TESTS_DIR / "tmp"
FIXTURES_DIR = TESTS_DIR / "fixtures"
| 19.625 | 37 | 0.719745 |
from pathlib import Path
TESTS_DIR = Path(__file__).parent
TMP_DIR = TESTS_DIR / "tmp"
FIXTURES_DIR = TESTS_DIR / "fixtures"
| true | true |
f77215a780aefe1698dd92fb73582c989c9e6979 | 5,577 | py | Python | test/unit/verifier/lint/test_rubocop.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | test/unit/verifier/lint/test_rubocop.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | test/unit/verifier/lint/test_rubocop.py | dericcrago/molecule | cb4dec0a7d4993395f123b2c9b0590d41e9dd557 | [
"MIT"
] | null | null | null | # 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, merge, publish, distribute, sublicense, and/or
# sell... | 30.642857 | 87 | 0.737852 |
import pytest
import sh
from molecule import config
from molecule.verifier.lint import rubocop
from test.functional.conftest import needs_rubocop
pytestmark = needs_rubocop
@pytest.fixture
def _patched_get_tests(mocker):
m = mocker.patch('molecule.verifier.lint.rubocop.RuboCop._get_tests')
m.return_value ... | true | true |
f77215bc6d58c7aaaf29b8e874db9c78671a0245 | 4,114 | py | Python | src/prefect/serialization/schedule.py | znicholasbrown/prefect | a91d039e7885185a6b4e62d20d44f85d8ff680ac | [
"Apache-2.0"
] | null | null | null | src/prefect/serialization/schedule.py | znicholasbrown/prefect | a91d039e7885185a6b4e62d20d44f85d8ff680ac | [
"Apache-2.0"
] | null | null | null | src/prefect/serialization/schedule.py | znicholasbrown/prefect | a91d039e7885185a6b4e62d20d44f85d8ff680ac | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING, Any
import marshmallow
from marshmallow import fields, post_load, post_dump
import prefect
from prefect.serialization import schedule_compat
from prefect.utilities.serialization import (
DateTimeTZ,
ObjectSchema,
OneOfSchema,
StatefulFunctionReference,
to_qualifie... | 29.385714 | 92 | 0.694458 | from typing import TYPE_CHECKING, Any
import marshmallow
from marshmallow import fields, post_load, post_dump
import prefect
from prefect.serialization import schedule_compat
from prefect.utilities.serialization import (
DateTimeTZ,
ObjectSchema,
OneOfSchema,
StatefulFunctionReference,
to_qualifie... | true | true |
f77215c8ba2162b8cc1daa321023c7ffc7ddb2dd | 3,339 | py | Python | picard/_tools.py | arokem/picard | 1ca98a51b60bc51bfcf8767dea989cc4f5b8b522 | [
"BSD-3-Clause"
] | 79 | 2017-10-30T17:11:42.000Z | 2022-02-07T15:10:47.000Z | picard/_tools.py | arokem/picard | 1ca98a51b60bc51bfcf8767dea989cc4f5b8b522 | [
"BSD-3-Clause"
] | 34 | 2017-11-03T10:38:41.000Z | 2021-12-15T14:11:33.000Z | picard/_tools.py | arokem/picard | 1ca98a51b60bc51bfcf8767dea989cc4f5b8b522 | [
"BSD-3-Clause"
] | 19 | 2017-10-27T15:44:37.000Z | 2021-12-18T10:22:27.000Z | # Authors: Pierre Ablin <pierre.ablin@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Francois Cardoso <cardoso@iap.fr>
#
# License: BSD (3-clause)
import numbers
import numpy as np
def permute(A, scale=True):
'''Get a permutation to diagonalize and scale a matrix
Param... | 28.538462 | 78 | 0.570231 | import numbers
import numpy as np
def permute(A, scale=True):
A = A.copy()
n = A.shape[0]
idx = np.arange(n)
done = False
while not done:
done = True
for i in range(n):
for j in range(i):
if A[i, i] ** 2 + A[j, j] ** 2 < A[i, j] ** 2 + A[j, i] ** 2:
... | true | true |
f77215cdca38d10ce6981cc9f5661d99ecc4216c | 1,416 | py | Python | roku_scanner/custom_types.py | CCecilia/Roku-Scanner | def8668747258f0edbea86022805beff1f9fd304 | [
"MIT"
] | null | null | null | roku_scanner/custom_types.py | CCecilia/Roku-Scanner | def8668747258f0edbea86022805beff1f9fd304 | [
"MIT"
] | 6 | 2020-05-11T22:54:27.000Z | 2020-05-24T04:17:49.000Z | roku_scanner/custom_types.py | CCecilia/Roku-Scanner | def8668747258f0edbea86022805beff1f9fd304 | [
"MIT"
] | null | null | null | import argparse
import asyncio
import pathlib
import requests
import socket
from typing import Dict, TypedDict, Union
"""
Type Descriptions
-*- any not listed are imported from modules -*-
DiscoveryData:
Cache-Control: str
ST: str
USN: str
Ext: str
Server: str
LOCATION: str
device-gr... | 16.465116 | 48 | 0.621469 | import argparse
import asyncio
import pathlib
import requests
import socket
from typing import Dict, TypedDict, Union
class EcpData(TypedDict):
data: dict
xml: str
class DeviceData(TypedDict):
device_info: EcpData
apps: EcpData
active_app: EcpData
media_player: EcpData
class RokuApp(Type... | true | true |
f77216afb369b102d30bb347a3ba35c04b0457aa | 434 | py | Python | setup.py | robertoachar/docker-python-flask | a44aeb6f9303802df55ad0dbe6cea26f5be21a0f | [
"MIT"
] | 4 | 2017-11-10T18:28:06.000Z | 2019-03-22T21:33:02.000Z | setup.py | robertoachar/docker-python-flask | a44aeb6f9303802df55ad0dbe6cea26f5be21a0f | [
"MIT"
] | null | null | null | setup.py | robertoachar/docker-python-flask | a44aeb6f9303802df55ad0dbe6cea26f5be21a0f | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='docker_python_flask',
version='1.0.0',
description='A playground for Docker with Python and Flask.',
author='Roberto Achar',
author_email='robertoachar@gmail.com',
packages=['docker_python_flask'],
entry_points={
'console_scripts': ... | 28.933333 | 69 | 0.635945 | from setuptools import setup
setup(name='docker_python_flask',
version='1.0.0',
description='A playground for Docker with Python and Flask.',
author='Roberto Achar',
author_email='robertoachar@gmail.com',
packages=['docker_python_flask'],
entry_points={
'console_scripts': ... | true | true |
f7721757b5878b495fd9f251776ea4fc7c4e776e | 1,190 | py | Python | utils/audio_utils.py | VitaNova1998/REP | abc640dfca1b23237770b0508f79c45b84baf81b | [
"Apache-2.0"
] | 5 | 2018-04-26T21:58:02.000Z | 2020-07-15T07:09:45.000Z | utils/audio_utils.py | VitaNova1998/REP | abc640dfca1b23237770b0508f79c45b84baf81b | [
"Apache-2.0"
] | 1 | 2019-06-14T08:07:51.000Z | 2019-06-19T21:53:27.000Z | utils/audio_utils.py | VitaNova1998/REP | abc640dfca1b23237770b0508f79c45b84baf81b | [
"Apache-2.0"
] | 3 | 2020-06-15T06:37:53.000Z | 2021-09-03T14:10:53.000Z | import numpy as np
import librosa
from scipy import signal
import fnmatch
import os
def preemphasis(x, coeff=0.97):
return signal.lfilter([1, -coeff], [1], x)
def inv_preemphasis(x, coeff=0.97):
return signal.lfilter([1], [1, -coeff], x)
def griffin_lim(stft_matrix_,
n_fft,
... | 24.791667 | 70 | 0.589076 | import numpy as np
import librosa
from scipy import signal
import fnmatch
import os
def preemphasis(x, coeff=0.97):
return signal.lfilter([1, -coeff], [1], x)
def inv_preemphasis(x, coeff=0.97):
return signal.lfilter([1], [1, -coeff], x)
def griffin_lim(stft_matrix_,
n_fft,
... | true | true |
f772190ca4e99ab865f103a6563399f10f0f6bdb | 5,961 | py | Python | leetcode_python/Binary_Search/split-array-largest-sum.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Binary_Search/split-array-largest-sum.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Binary_Search/split-array-largest-sum.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
410. Split Array Largest Sum
Hard
Given an array nums which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays.
Write an algorithm to minimize the largest sum among these m subarrays.
Example 1:
Input: nums = [7,2,5,10,8], m = 2
Output: 18
Expla... | 37.727848 | 140 | 0.599396 |
class Solution:
def splitArray(self, nums: List[int], m: int) -> int:
def min_subarrays_required(max_sum_allowed: int) -> int:
current_sum = 0
splits_required = 0
for element in nums:
if current_sum + element <= max_... | true | true |
f772194e85e1c4114cad7b464c096e34356aea10 | 11,782 | py | Python | google/cloud/firestore_v1/async_query.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | 2 | 2021-09-17T10:55:14.000Z | 2021-09-17T10:55:38.000Z | google/cloud/firestore_v1/async_query.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | 2 | 2020-04-01T07:31:01.000Z | 2020-11-30T07:03:51.000Z | google/cloud/firestore_v1/async_query.py | Arushi201296/python-firestore | 784e8ae27d42d8e25deacaf37c34d79369738b00 | [
"Apache-2.0"
] | 1 | 2021-05-31T18:23:02.000Z | 2021-05-31T18:23:02.000Z | # Copyright 2020 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 38.884488 | 88 | 0.634782 |
from google.api_core import gapic_v1 from google.api_core import retry as retries
from google.cloud.firestore_v1.base_query import (
BaseCollectionGroup,
BaseQuery,
QueryPartition,
_query_response_to_snapshot,
_collection_group_query_response_to_snapshot,
_enum_from_direction,
)
from googl... | true | true |
f772197730ab67af6d5c2234b498f291f12bccbc | 23,810 | py | Python | tests/wallet/cc_wallet/test_cc_wallet.py | venustar1228/cactus-blockchain | a2fec724eb19489898ffa306d4203de11edb94b0 | [
"Apache-2.0"
] | 20 | 2021-07-16T18:08:13.000Z | 2022-03-20T02:38:39.000Z | tests/wallet/cc_wallet/test_cc_wallet.py | Cactus-Network/cactus-blockchain | 9eef13171dff764bd0549de1479d775272e16bcc | [
"Apache-2.0"
] | 29 | 2021-07-17T00:38:18.000Z | 2022-03-29T19:11:48.000Z | tests/wallet/cc_wallet/test_cc_wallet.py | venustar1228/cactus-blockchain | a2fec724eb19489898ffa306d4203de11edb94b0 | [
"Apache-2.0"
] | 21 | 2021-07-17T02:18:57.000Z | 2022-03-15T08:26:56.000Z | import asyncio
from typing import List
import pytest
from cactus.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from cactus.full_node.mempool_manager import MempoolManager
from cactus.simulator.simulator_protocol import FarmNewBlockProtocol
from cactus.types.blockchain_format.coin ... | 43.290909 | 120 | 0.702016 | import asyncio
from typing import List
import pytest
from cactus.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from cactus.full_node.mempool_manager import MempoolManager
from cactus.simulator.simulator_protocol import FarmNewBlockProtocol
from cactus.types.blockchain_format.coin ... | true | true |
f772199aafd5e037c62d004bbe43e0cfba757028 | 1,487 | py | Python | stat.py | cpurta/bit-stat | 9affaf18a66703609c8e51a54e44ad8d155c5dba | [
"MIT"
] | null | null | null | stat.py | cpurta/bit-stat | 9affaf18a66703609c8e51a54e44ad8d155c5dba | [
"MIT"
] | null | null | null | stat.py | cpurta/bit-stat | 9affaf18a66703609c8e51a54e44ad8d155c5dba | [
"MIT"
] | null | null | null | import urllib
import json
from bs4 import BeautifulSoup
from flask import Flask
statDims = {
"Blocks Mined": "blocks_mined",
"Time Between Blocks": "time_between_blocks",
"Bitcoins Mined": "bitcoins_mined",
"Total Transaction Fees": "total_transaction_fees",
"No. of Transactions": "num_transactions",
"Total Output Vol... | 26.553571 | 73 | 0.724277 | import urllib
import json
from bs4 import BeautifulSoup
from flask import Flask
statDims = {
"Blocks Mined": "blocks_mined",
"Time Between Blocks": "time_between_blocks",
"Bitcoins Mined": "bitcoins_mined",
"Total Transaction Fees": "total_transaction_fees",
"No. of Transactions": "num_transactions",
"Total Output Vol... | true | true |
f77219ab8029a52314bb4ab03077e2f00c657845 | 495 | py | Python | examples/s3_cv_map_example.py | judyheflin/amazon-s3-plugin-for-pytorch | 38284c8a5e92be3bbf47b08e8c90d94be0cb79e7 | [
"Apache-2.0"
] | 105 | 2021-06-07T09:07:26.000Z | 2022-03-31T15:03:00.000Z | examples/s3_cv_map_example.py | judyheflin/amazon-s3-plugin-for-pytorch | 38284c8a5e92be3bbf47b08e8c90d94be0cb79e7 | [
"Apache-2.0"
] | 21 | 2021-09-09T23:40:52.000Z | 2022-03-21T15:55:23.000Z | examples/s3_cv_map_example.py | judyheflin/amazon-s3-plugin-for-pytorch | 38284c8a5e92be3bbf47b08e8c90d94be0cb79e7 | [
"Apache-2.0"
] | 13 | 2021-07-10T14:31:09.000Z | 2022-02-26T23:37:35.000Z |
from awsio.python.lib.io.s3.s3dataset import S3Dataset
from torch.utils.data import DataLoader
url_list = ['s3://image-data-bucket/train/n01440764/n01440764_10026.JPEG',
's3://image-data-bucket/train/n01440764/n01440764_10027.JPEG',
's3://image-data-bucket/train/n01440764/n01440764_10029.JPEG']
dataset = S3Dataset... | 29.117647 | 74 | 0.747475 |
from awsio.python.lib.io.s3.s3dataset import S3Dataset
from torch.utils.data import DataLoader
url_list = ['s3://image-data-bucket/train/n01440764/n01440764_10026.JPEG',
's3://image-data-bucket/train/n01440764/n01440764_10027.JPEG',
's3://image-data-bucket/train/n01440764/n01440764_10029.JPEG']
dataset = S3Dataset... | true | true |
f7721aa6e8152f686c1e86643d61f77c922ec0dd | 36,168 | py | Python | tests/model_fields/test_jsonfield.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/model_fields/test_jsonfield.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/model_fields/test_jsonfield.py | mustafa0x/django | d7394cfa13a4d1a02356e3a83e10ec100fbb9948 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | import operator
import uuid
from unittest import mock
from django import forms
from django.core import serializers
from django.core.exceptions import ValidationError
from django.core.serializers.json import DjangoJSONEncoder
from django.db import (
DataError, IntegrityError, NotSupportedError, OperationalError, co... | 38.354189 | 100 | 0.57161 | import operator
import uuid
from unittest import mock
from django import forms
from django.core import serializers
from django.core.exceptions import ValidationError
from django.core.serializers.json import DjangoJSONEncoder
from django.db import (
DataError, IntegrityError, NotSupportedError, OperationalError, co... | true | true |
f7721af2475a2242cd7071766509a52e811a2694 | 3,750 | py | Python | sdk/python/pulumi_azure_nextgen/hybridnetwork/v20200101preview/get_vendor.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/hybridnetwork/v20200101preview/get_vendor.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/hybridnetwork/v20200101preview/get_vendor.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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
from ... import _utilities, _tables
from... | 32.327586 | 193 | 0.641867 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetVendorResult',
'AwaitableGetVendorResult',
'get_vendor',
]
@pulumi.output_type
class GetVendorResult:
def __init__(_... | true | true |
f7721b1610e64ab3a34921b9b8b364350ebadb18 | 2,420 | py | Python | src/api/bkuser_core/common/notifier.py | Chace-wang/bk-user | 057f270d66a1834312306c9fba1f4e95521f10b1 | [
"MIT"
] | null | null | null | src/api/bkuser_core/common/notifier.py | Chace-wang/bk-user | 057f270d66a1834312306c9fba1f4e95521f10b1 | [
"MIT"
] | null | null | null | src/api/bkuser_core/common/notifier.py | Chace-wang/bk-user | 057f270d66a1834312306c9fba1f4e95521f10b1 | [
"MIT"
] | 1 | 2021-12-31T06:48:41.000Z | 2021-12-31T06:48:41.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 33.150685 | 115 | 0.700826 | import base64
import logging
from typing import List
from bkuser_core.esb_sdk.shortcuts import get_client_by_raw_username
from django.conf import settings
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
logger = logging.getLogger(__name__)
DEFAULT_EMAIL_SENDER = "... | true | true |
f7721bd1444c20e2393fd7c1026851a1ad081cc9 | 657 | py | Python | src/nsupdate/main/migrations/0011_auto_20170526_2113.py | mirzazulfan/nsupdate.info | fdd12e8f47d084969e23517fce4b8efa3212dd9e | [
"BSD-3-Clause"
] | 774 | 2015-01-01T23:24:50.000Z | 2022-03-29T01:40:41.000Z | src/nsupdate/main/migrations/0011_auto_20170526_2113.py | mirzazulfan/nsupdate.info | fdd12e8f47d084969e23517fce4b8efa3212dd9e | [
"BSD-3-Clause"
] | 272 | 2015-01-02T12:23:41.000Z | 2022-02-21T14:18:11.000Z | src/nsupdate/main/migrations/0011_auto_20170526_2113.py | mirzazulfan/nsupdate.info | fdd12e8f47d084969e23517fce4b8efa3212dd9e | [
"BSD-3-Clause"
] | 100 | 2015-03-05T15:11:09.000Z | 2022-03-09T18:39:39.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('main', '0010_auto_20151229_1717'),
]
operations = [
migrations.AlterField(
model_n... | 31.285714 | 280 | 0.65449 | from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('main', '0010_auto_20151229_1717'),
]
operations = [
migrations.AlterField(
model_name='domain',
... | true | true |
f7721c10cce179af262e3ef00ac909e6a4fceff6 | 9,244 | py | Python | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/mission_report.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.core.elements import Link
from onegov.core.security import Public, Private
from onegov.form import FieldDependency, WTFormsClassBuilder, move_fields
from onegov.org.views.files import view_get_image_collection
from onegov.winterthur import WinterthurApp, _
from onegov.winterthur.co... | 28.619195 | 76 | 0.636629 | from datetime import date
from onegov.core.elements import Link
from onegov.core.security import Public, Private
from onegov.form import FieldDependency, WTFormsClassBuilder, move_fields
from onegov.org.views.files import view_get_image_collection
from onegov.winterthur import WinterthurApp, _
from onegov.winterthur.co... | true | true |
f7721c7c8627b5e8bbb0d8bbd96c0e8675068be9 | 2,027 | py | Python | run_models_on_simulated_data.py | dvav/clonosGP | e7f9a08869df0e1857fe24e4e311999f7ba6560f | [
"MIT"
] | 9 | 2020-01-28T03:22:36.000Z | 2022-01-11T09:38:22.000Z | run_models_on_simulated_data.py | dvav/clonosGP | e7f9a08869df0e1857fe24e4e311999f7ba6560f | [
"MIT"
] | 2 | 2021-10-05T12:24:02.000Z | 2022-01-09T12:33:23.000Z | run_models_on_simulated_data.py | dvav/clonosGP | e7f9a08869df0e1857fe24e4e311999f7ba6560f | [
"MIT"
] | null | null | null | import os
import sys
IDX = int(sys.argv[1])
os.environ['THEANO_FLAGS'] = f'base_compiledir="theano/p{IDX}"'
import tqdm as tqd
import itertools as itr
import numpy as nmp
import pandas as pnd
import sklearn.metrics as mtr
import scipy.special as scp
import pymc3 as pmc
import clonosGP as cln
##
def run_model(prio... | 31.671875 | 150 | 0.594475 | import os
import sys
IDX = int(sys.argv[1])
os.environ['THEANO_FLAGS'] = f'base_compiledir="theano/p{IDX}"'
import tqdm as tqd
import itertools as itr
import numpy as nmp
import pandas as pnd
import sklearn.metrics as mtr
import scipy.special as scp
import pymc3 as pmc
import clonosGP as cln
def run_model(prior, ... | true | true |
f7721d3f18a732ab1f687e1dcb5b12f34139671f | 157 | py | Python | Mojo/Resources/Project/runserver.py | lonelycode/Mojo | 594892ee0239e2ae43d47b04406224b3d4543c3b | [
"Apache-2.0"
] | 14 | 2015-02-11T05:01:34.000Z | 2018-11-12T03:20:37.000Z | Mojo/Resources/Project/runserver.py | lonelycode/Mojo | 594892ee0239e2ae43d47b04406224b3d4543c3b | [
"Apache-2.0"
] | null | null | null | Mojo/Resources/Project/runserver.py | lonelycode/Mojo | 594892ee0239e2ae43d47b04406224b3d4543c3b | [
"Apache-2.0"
] | null | null | null | import sys
from Mojo.ServerHelpers import RunServer
modname = globals()['__name__']
thisModule = sys.modules[modname]
RunServer.init_run_server(thisModule) | 22.428571 | 40 | 0.815287 | import sys
from Mojo.ServerHelpers import RunServer
modname = globals()['__name__']
thisModule = sys.modules[modname]
RunServer.init_run_server(thisModule) | true | true |
f7721e2a18329f6c1f86007d26465013a80ac5a3 | 37,996 | py | Python | impacket/smbconnection.py | Remediant/impacket | 1429750288e026f196b656e0f4227d69894c5775 | [
"Apache-1.1"
] | null | null | null | impacket/smbconnection.py | Remediant/impacket | 1429750288e026f196b656e0f4227d69894c5775 | [
"Apache-1.1"
] | null | null | null | impacket/smbconnection.py | Remediant/impacket | 1429750288e026f196b656e0f4227d69894c5775 | [
"Apache-1.1"
] | null | null | null | # Copyright (c) 2003-2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author: Alberto Solino (@agsolino)
#
# Description:
#
# Wrapper class for SMB1/2/3 so it's transparen... | 43.177273 | 151 | 0.624671 | # You can still play with the low level methods (version dependent)
# by calling getSMBServer()
#
import ntpath
import string
import socket
from impacket import smb, smb3, nmb, nt_errors, LOG
from smb3structs import *
# So the user doesn't need to import smb, the smb3 are already in here
SMB_DIALECT = smb.SMB_DIALE... | false | true |
f7721e8e39fa732a49e7dad1ff907a3be3ead05e | 765 | py | Python | rtamt/operation/stl_ct/not_operation.py | BentleyJOakes/rtamt | 5366349c44afb53cffa5fb29e43fea1eb23b6c52 | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | null | null | null | rtamt/operation/stl_ct/not_operation.py | BentleyJOakes/rtamt | 5366349c44afb53cffa5fb29e43fea1eb23b6c52 | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | null | null | null | rtamt/operation/stl_ct/not_operation.py | BentleyJOakes/rtamt | 5366349c44afb53cffa5fb29e43fea1eb23b6c52 | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | 1 | 2022-01-28T15:59:05.000Z | 2022-01-28T15:59:05.000Z | from rtamt.operation.abstract_operation import AbstractOperation
class NotOperation(AbstractOperation):
def __init__(self):
self.input = []
def update(self, *args, **kargs):
out = []
input_list = args[0]
for in_sample in input_list:
out_time = in_sample[0]
... | 23.181818 | 64 | 0.573856 | from rtamt.operation.abstract_operation import AbstractOperation
class NotOperation(AbstractOperation):
def __init__(self):
self.input = []
def update(self, *args, **kargs):
out = []
input_list = args[0]
for in_sample in input_list:
out_time = in_sample[0]
... | true | true |
f7721ea4be219705bf5d0c25f182d5f29f553670 | 19,796 | py | Python | tests/test_git_repository.py | corvin-quodai/pydriller | 4e2d125981a0fd92dbbf0c672c9656f1011fd0b6 | [
"Apache-2.0"
] | null | null | null | tests/test_git_repository.py | corvin-quodai/pydriller | 4e2d125981a0fd92dbbf0c672c9656f1011fd0b6 | [
"Apache-2.0"
] | null | null | null | tests/test_git_repository.py | corvin-quodai/pydriller | 4e2d125981a0fd92dbbf0c672c9656f1011fd0b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Davide Spadini
#
# 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... | 39.751004 | 117 | 0.743433 | from datetime import datetime, timezone, timedelta
from pathlib import Path
import pytest
from git import Git
from pydriller.domain.commit import ModificationType
from pydriller.git_repository import GitRepository
@pytest.fixture
def repo(request):
gr = GitRepository(request.param)
yield gr
gr.clear()
... | true | true |
f7721ee3d4936aeb64c8eec8b3b37f26b070705d | 2,420 | py | Python | BeautiBot/Discord/intent/Loki_medicalHistory.py | marcnhwu/LokiHub | 52d0bccf313c44f25dd79590cdef7b604cd37f1a | [
"MIT"
] | 17 | 2020-11-25T07:40:18.000Z | 2022-03-07T03:29:18.000Z | BeautiBot/Discord/intent/Loki_medicalHistory.py | marcnhwu/LokiHub | 52d0bccf313c44f25dd79590cdef7b604cd37f1a | [
"MIT"
] | 8 | 2020-12-18T13:23:59.000Z | 2021-10-03T21:41:50.000Z | BeautiBot/Discord/intent/Loki_medicalHistory.py | marcnhwu/LokiHub | 52d0bccf313c44f25dd79590cdef7b604cd37f1a | [
"MIT"
] | 43 | 2020-12-02T09:03:57.000Z | 2021-12-23T03:30:25.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Loki module for medicalHistory
Input:
inputSTR str,
utterance str,
args str[],
resultDICT dict
Output:
resultDICT dict
"""
DEBUG_medicalHistory = True
userDefinedDICT = {"bodypart": ["毛", "腋... | 33.150685 | 395 | 0.533471 |
DEBUG_medicalHistory = True
userDefinedDICT = {"bodypart": ["毛", "腋", "腋下", "腿", "小腿", "大腿", "膝蓋", "腳", "腳趾", "腳背", "比基尼線", "私密處", "手", "手臂", "上手臂", "下手臂", "全手", "手指", "手背", "臉", "全臉", "鬍子", "眉心", "唇周", "下巴", "頸", "前頸", "後頸", "胸", "胸部", "腹", "腹部", "子母線", "背", "上背", "下背", "臀", "臀部", "乳暈", "胳肢窩", "陰", "陰部"], "location"... | true | true |
f7721f708c27f11e91a2f2d945a99f7ffa5f35e7 | 255 | py | Python | celery_app/celery_app.py | chenx6/message-integration-api | 5a80eac8d72620af87bbdb16cf489858001c9d8f | [
"MIT"
] | null | null | null | celery_app/celery_app.py | chenx6/message-integration-api | 5a80eac8d72620af87bbdb16cf489858001c9d8f | [
"MIT"
] | null | null | null | celery_app/celery_app.py | chenx6/message-integration-api | 5a80eac8d72620af87bbdb16cf489858001c9d8f | [
"MIT"
] | null | null | null | from celery import Celery
# TODO 用 Redis 或者 RabbitMQ 代替 SQLite
celery_app = Celery(
broker="sqla+sqlite:///instance/celery_broker.db",
backend="db+sqlite:///instance/celery_backend.db",
)
celery_app.config_from_object("celery_app.celeryconfig")
| 25.5 | 56 | 0.760784 | from celery import Celery
celery_app = Celery(
broker="sqla+sqlite:///instance/celery_broker.db",
backend="db+sqlite:///instance/celery_backend.db",
)
celery_app.config_from_object("celery_app.celeryconfig")
| true | true |
f7721f8fab3efc187ee67e8163c79fc0114b1410 | 2,097 | py | Python | src/rest_search/views.py | wemap/django-rest-search | 82287c0947262cfb6785fa0a6dab623520e62436 | [
"BSD-2-Clause"
] | 7 | 2016-12-06T10:09:18.000Z | 2021-09-02T01:43:18.000Z | src/rest_search/views.py | wemap/django-rest-search | 82287c0947262cfb6785fa0a6dab623520e62436 | [
"BSD-2-Clause"
] | 5 | 2020-10-05T08:26:18.000Z | 2021-12-14T14:24:33.000Z | src/rest_search/views.py | wemap/django-rest-search | 82287c0947262cfb6785fa0a6dab623520e62436 | [
"BSD-2-Clause"
] | 3 | 2017-05-02T13:51:26.000Z | 2021-09-01T15:03:56.000Z | # -*- coding: utf-8 -*-
from rest_framework.exceptions import ValidationError
from rest_framework.filters import BaseFilterBackend
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.views import APIView
from rest_search.schemas import get_form_schema_operation_parameters
class SearchFil... | 29.957143 | 83 | 0.652837 |
from rest_framework.exceptions import ValidationError
from rest_framework.filters import BaseFilterBackend
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.views import APIView
from rest_search.schemas import get_form_schema_operation_parameters
class SearchFilterBackend(BaseFilterBac... | true | true |
f772205eaf70234012a61c20d0dbeb734219c36a | 2,256 | py | Python | forge/trinity/sword.py | shwang/neural-mmo | c5b9a0f4317ec863110b24487312db0afc335fff | [
"MIT"
] | 1 | 2019-08-11T03:14:56.000Z | 2019-08-11T03:14:56.000Z | forge/trinity/sword.py | shouhu666/neural-mmo | f02dc86f63489dc80c8ce70eefc6fa94ac1f1dc0 | [
"MIT"
] | null | null | null | forge/trinity/sword.py | shouhu666/neural-mmo | f02dc86f63489dc80c8ce70eefc6fa94ac1f1dc0 | [
"MIT"
] | null | null | null | from pdb import set_trace as T
import ray
import pickle
import time
from forge.blade.core import realm
from forge.trinity.timed import Timed, runtime, waittime
#Agent logic
class Sword(Timed):
'''A simple Core level interface for generic,
persistent, and asynchronous computation over
a colocated Neural MMO ... | 28.923077 | 61 | 0.649823 | from pdb import set_trace as T
import ray
import pickle
import time
from forge.blade.core import realm
from forge.trinity.timed import Timed, runtime, waittime
class Sword(Timed):
def __init__(self, trinity, config, args, idx):
super().__init__()
self.env = realm.Realm(config, args, idx)
self.env... | true | true |
f772216c61ab81d6ef94984c06dcb1295f71472b | 910 | py | Python | tests/packages/sub_package/kitty/smallkitty.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/packages/sub_package/kitty/smallkitty.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | null | null | null | tests/packages/sub_package/kitty/smallkitty.py | Mortal/Nuitka | 5150eeff7ff845ed4993c773449cd81b7f127c6b | [
"Apache-2.0"
] | 1 | 2018-12-16T23:51:18.000Z | 2018-12-16T23:51:18.000Z | # Copyright 2018, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... | 43.333333 | 78 | 0.713187 | # indicated.
#
# 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 w... | true | true |
f772217743f84ddfe9f205bd35ac6f946a8c8cc0 | 2,126 | py | Python | fr/modules/analyzers/facedetector.py | ktnyt/SeedWBA | d0aff77712c9cae78f4ae9c12672915d85df4be2 | [
"Apache-2.0"
] | null | null | null | fr/modules/analyzers/facedetector.py | ktnyt/SeedWBA | d0aff77712c9cae78f4ae9c12672915d85df4be2 | [
"Apache-2.0"
] | null | null | null | fr/modules/analyzers/facedetector.py | ktnyt/SeedWBA | d0aff77712c9cae78f4ae9c12672915d85df4be2 | [
"Apache-2.0"
] | 2 | 2018-03-09T11:51:45.000Z | 2018-06-06T06:03:21.000Z | # -*- coding: utf-8 -*-
import cv2
import time
# cascade_path = "./haarcascades/haarcascade_frontalface_default.xml"
cascade_path = "/var/opencv/haarcascades/haarcascade_frontalface_default.xml"
class FaceDetector(object):
facerect = None
refreshRate = 0.1 # sec
lastRefreshed = 0.0 # sec
@classmethod... | 34.852459 | 104 | 0.640169 | import cv2
import time
cascade_path = "/var/opencv/haarcascades/haarcascade_frontalface_default.xml"
class FaceDetector(object):
facerect = None
refreshRate = 0.1 lastRefreshed = 0.0
@classmethod
def getFacerect(self, observation):
if (time.time() - FaceDetector.lastRefreshed) < F... | true | true |
f77221e52db0ca8117081c3778922d614b068a58 | 3,372 | py | Python | gnuradio-3.7.13.4/grc/gui/Constants.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/grc/gui/Constants.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/grc/gui/Constants.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... | 29.321739 | 92 | 0.779656 |
import gtk
from ..core.Constants import *
DEFAULT_FILE_PATH = os.getcwd() if os.name != 'nt' else os.path.expanduser("~/Documents")
IMAGE_FILE_EXTENSION = '.png'
TEXT_FILE_EXTENSION = '.txt'
NEW_FLOGRAPH_TITLE = 'untitled'
MIN_WINDOW_WIDTH = 600
MIN_WINDOW_HEIGHT = 400
MIN_DIALOG_WIDTH = 500
MIN_DIALOG_HEIGHT = ... | true | true |
f77221fd112504e65c17037c0f315047a4225097 | 1,131 | py | Python | processlib/preProcess.py | Dead-Lemon/csvDir2influx | ad0fe0a43a4df75a821f6b832675bf1e3d4d4b12 | [
"BSD-3-Clause"
] | null | null | null | processlib/preProcess.py | Dead-Lemon/csvDir2influx | ad0fe0a43a4df75a821f6b832675bf1e3d4d4b12 | [
"BSD-3-Clause"
] | null | null | null | processlib/preProcess.py | Dead-Lemon/csvDir2influx | ad0fe0a43a4df75a821f6b832675bf1e3d4d4b12 | [
"BSD-3-Clause"
] | null | null | null | import json
preConf = {'removeID' : '_A_'}
try:
with open(os.path.join('processlib', 'pre.json')) as configdata:
preConf = json.load(configdata)
except:
print('no config file, defaulting preprocess')
def removeUnwanted(Filelist): #remove unwated csv from file list
#print(Filelist)
newFi... | 29 | 94 | 0.678161 | import json
preConf = {'removeID' : '_A_'}
try:
with open(os.path.join('processlib', 'pre.json')) as configdata:
preConf = json.load(configdata)
except:
print('no config file, defaulting preprocess')
def removeUnwanted(Filelist): newFilelist = []
for i in Filelist:
if preCon... | true | true |
f77223bdbe56106136e4f4c8bd699a7af12e17ae | 15,570 | py | Python | ledger/payments/pdf.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 5 | 2018-02-12T03:16:36.000Z | 2019-09-07T20:36:37.000Z | ledger/payments/pdf.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 162 | 2018-02-16T05:13:03.000Z | 2021-05-14T02:47:37.000Z | ledger/payments/pdf.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 14 | 2018-02-15T05:22:36.000Z | 2022-02-15T08:24:43.000Z | import os
from decimal import Decimal as D
from io import BytesIO
from oscar.templatetags.currency_filters import currency
from reportlab.lib import enums
from reportlab.lib.pagesizes import A4
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer, Table, TableStyle, ListFlowable, \
... | 44.358974 | 186 | 0.688632 | import os
from decimal import Decimal as D
from io import BytesIO
from oscar.templatetags.currency_filters import currency
from reportlab.lib import enums
from reportlab.lib.pagesizes import A4
from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame, Paragraph, Spacer, Table, TableStyle, ListFlowable, \
... | true | true |
f77224f5c1b7f2319f158b428a0faca591f86ce7 | 1,314 | py | Python | TorchUtils.py | CancerDataScience/NuCLS | c172b55b18d4ea78c3f51a8fd28ee6c2595c8360 | [
"MIT"
] | 7 | 2021-02-18T18:24:45.000Z | 2021-05-02T07:37:27.000Z | TorchUtils.py | CancerDataScience/NuCLS | c172b55b18d4ea78c3f51a8fd28ee6c2595c8360 | [
"MIT"
] | 5 | 2021-03-06T03:26:15.000Z | 2021-05-27T07:45:29.000Z | TorchUtils.py | CancerDataScience/NuCLS | c172b55b18d4ea78c3f51a8fd28ee6c2595c8360 | [
"MIT"
] | 8 | 2021-02-24T14:06:46.000Z | 2021-05-18T09:26:58.000Z | import torch
import nucls_model.torchvision_detection_utils.transforms as tvdt
ISCUDA = torch.cuda.is_available()
def tensor_isin(arr1, arr2):
r""" Compares a tensor element-wise with a list of possible values.
See :func:`torch.isin`
Source: https://github.com/pytorch/pytorch/pull/26144
"""
res... | 28.565217 | 71 | 0.678843 | import torch
import nucls_model.torchvision_detection_utils.transforms as tvdt
ISCUDA = torch.cuda.is_available()
def tensor_isin(arr1, arr2):
result = (arr1[..., None] == arr2).any(-1)
return result.type(torch.ByteTensor)
def transform_dlinput(
tlist=None, make_tensor=True, flip_prob=0.5,
... | true | true |
f77225852fb6ec9d487b56cfa5d61b6e51ed6060 | 5,670 | py | Python | elasticsearch_dsl/field.py | dcwatson/elasticsearch-dsl-py | 32c17491b8ffb62fe16ab5004636646d6ff68c7c | [
"Apache-2.0"
] | null | null | null | elasticsearch_dsl/field.py | dcwatson/elasticsearch-dsl-py | 32c17491b8ffb62fe16ab5004636646d6ff68c7c | [
"Apache-2.0"
] | null | null | null | elasticsearch_dsl/field.py | dcwatson/elasticsearch-dsl-py | 32c17491b8ffb62fe16ab5004636646d6ff68c7c | [
"Apache-2.0"
] | null | null | null | from datetime import date
from dateutil import parser
from six import itervalues
from .utils import DslBase, _make_dsl_class, ObjectBase, AttrDict, AttrList
from .exceptions import ValidationException
__all__ = ['construct_field', 'Object', 'Nested', 'Date', 'String', 'Float',
'Double', 'Byte', 'Short', 'Integer'... | 30 | 116 | 0.599295 | from datetime import date
from dateutil import parser
from six import itervalues
from .utils import DslBase, _make_dsl_class, ObjectBase, AttrDict, AttrList
from .exceptions import ValidationException
__all__ = ['construct_field', 'Object', 'Nested', 'Date', 'String', 'Float',
'Double', 'Byte', 'Short', 'Integer'... | true | true |
f77225c13c65d4a4219cd23290cb3884babc838f | 1,105 | py | Python | WebClient/app/urls.py | AnnaShaleva/DltcGeo | c7815688152ad68d1b89431235e84815884c45f3 | [
"Apache-2.0"
] | null | null | null | WebClient/app/urls.py | AnnaShaleva/DltcGeo | c7815688152ad68d1b89431235e84815884c45f3 | [
"Apache-2.0"
] | null | null | null | WebClient/app/urls.py | AnnaShaleva/DltcGeo | c7815688152ad68d1b89431235e84815884c45f3 | [
"Apache-2.0"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 33.484848 | 77 | 0.722172 | from django.contrib import admin
from django.urls import path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls import url
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('api.urls')),
]
urlpatterns += staticfiles_urlpatterns()
urlpatterns +=... | true | true |
f772260f82fcef62ed1f5af91c22e7800a60b8d3 | 20,639 | py | Python | apps/chat/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | apps/chat/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | apps/chat/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | import json
import channels.layers
from asgiref.sync import async_to_sync
from django.conf import settings
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse, reverse_lazy
from django.views.gene... | 39.015123 | 114 | 0.630215 | import json
import channels.layers
from asgiref.sync import async_to_sync
from django.conf import settings
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse, reverse_lazy
from django.views.gene... | true | true |
f772266df900264100cec5b33bd5d0291fb4591c | 2,088 | py | Python | application/scheduler/run_jobs.py | havess/daudit | 6a60d95d5a28b6fdcf439f2598ad1df0fd5b760b | [
"MIT"
] | null | null | null | application/scheduler/run_jobs.py | havess/daudit | 6a60d95d5a28b6fdcf439f2598ad1df0fd5b760b | [
"MIT"
] | null | null | null | application/scheduler/run_jobs.py | havess/daudit | 6a60d95d5a28b6fdcf439f2598ad1df0fd5b760b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import requests
import os
from datetime import datetime
# TODO The port should not be hard-coded, it should be determined through some sort of Daudit config
DAUDIT_PORT = 3000
DAUDIT_URL = "http://127.0.0.1:%d/daudit/jobs" % DAUDIT_PORT
CONFIG_PATH = 'config.json'
def main():
... | 36.631579 | 100 | 0.55364 |
import json
import requests
import os
from datetime import datetime
DAUDIT_PORT = 3000
DAUDIT_URL = "http://127.0.0.1:%d/daudit/jobs" % DAUDIT_PORT
CONFIG_PATH = 'config.json'
def main():
if os.path.isfile(CONFIG_PATH) and os.access(CONFIG_PATH, os.R_OK):
with open(CONFIG_PATH, 'r+') as config_file:... | true | true |
f77227654aeb28f52ed175178392ca69bf3beaed | 4,211 | py | Python | test/kernel/test_kernel_exp_comb.py | jingjieli95/UnarySim | 775b38fa2d6b05a69fd73acb4766e50200a5cc37 | [
"MIT"
] | 17 | 2020-04-26T19:38:03.000Z | 2022-02-23T02:05:08.000Z | test/kernel/test_kernel_exp_comb.py | pan185/UnarySim | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | [
"MIT"
] | 3 | 2021-11-03T18:20:29.000Z | 2022-02-11T16:30:16.000Z | test/kernel/test_kernel_exp_comb.py | pan185/UnarySim | c03386efdbb8151f3c33f34b44d1d6a6fc960434 | [
"MIT"
] | 9 | 2019-12-03T05:08:55.000Z | 2022-01-04T20:24:55.000Z | # %%
import torch
import math
from UnarySim.kernel.exp import expN1
from UnarySim.stream.gen import RNG, SourceGen, BSGen
from UnarySim.metric.metric import ProgError
import matplotlib.pyplot as plt
import time
import math
import numpy as np
# %%
def exp_comb_test(bw=8, mode="unipolar", rng="Sobol"):
device =... | 36.617391 | 94 | 0.563524 | import torch
import math
from UnarySim.kernel.exp import expN1
from UnarySim.stream.gen import RNG, SourceGen, BSGen
from UnarySim.metric.metric import ProgError
import matplotlib.pyplot as plt
import time
import math
import numpy as np
def exp_comb_test(bw=8, mode="unipolar", rng="Sobol"):
device = torch.dev... | true | true |
f772276c302f30f147b6d9e8ef51d0572af1eb19 | 22,671 | py | Python | u2net.py | ilvcd/Flux.jl | d22479318b5f2a19a0003f3201d9b145b4562f9f | [
"MIT"
] | null | null | null | u2net.py | ilvcd/Flux.jl | d22479318b5f2a19a0003f3201d9b145b4562f9f | [
"MIT"
] | null | null | null | u2net.py | ilvcd/Flux.jl | d22479318b5f2a19a0003f3201d9b145b4562f9f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
import torch.nn as nn
import math
import time
# class REBNCONVs(nn.Module):
# def __init__(self,in_ch=3,out_ch=3,dirate=1):
# super(REBNCONVs,self).__init__()
# self.conv_s1 = nn.Conv2d(in_ch,out_ch,3,padding=1*dirate,... | 29.558018 | 128 | 0.582153 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch
import torch.nn as nn
import math
import time
def _upsample_like1(src,tar):
src = F.upsample(src,size=tar.shape[2:],mode='bilinear')
return src
def _upsample_like(src,tar):
src_h,src_l = src
tar_h,tar_l = tar
sr... | true | true |
f7722867cb23acb169de842f3bac1cf58e1c207e | 2,650 | py | Python | asciidoxy/templates/swift/helpers.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | 14 | 2020-04-28T08:51:43.000Z | 2022-02-12T13:40:34.000Z | asciidoxy/templates/swift/helpers.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | 47 | 2020-05-18T14:19:31.000Z | 2022-03-04T13:46:46.000Z | asciidoxy/templates/swift/helpers.py | RerrerBuub/asciidoxy | 3402f37d59e30975e9919653465839e396f05513 | [
"Apache-2.0"
] | 8 | 2020-05-17T20:52:42.000Z | 2022-02-25T16:16:01.000Z | # Copyright (C) 2019-2021, TomTom (http://tomtom.com).
#
# 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 o... | 38.405797 | 99 | 0.673208 |
from typing import Iterator
from asciidoxy.model import Compound
from asciidoxy.templates.helpers import TemplateHelper
class SwiftTemplateHelper(TemplateHelper):
ARGS_BEFORE_TYPE = True
ARGS_TO_TYPE = " -> "
PARAM_NAME_FIRST = True
PARAM_NAME_SEP = ": "
def _method_prefix(self, method: Compoun... | true | true |
f772287103edaa19e496077ce21634b4fc7983fb | 1,664 | py | Python | datachimp/views/api/project.py | ModelChimp/datachimp | 3ca4ee1f1e93939f6f7e0e58b651782516e542ca | [
"BSD-2-Clause"
] | null | null | null | datachimp/views/api/project.py | ModelChimp/datachimp | 3ca4ee1f1e93939f6f7e0e58b651782516e542ca | [
"BSD-2-Clause"
] | null | null | null | datachimp/views/api/project.py | ModelChimp/datachimp | 3ca4ee1f1e93939f6f7e0e58b651782516e542ca | [
"BSD-2-Clause"
] | null | null | null | from uuid import uuid4
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework.decorators import api_view
from datachimp.models.project import Project
from datachimp.models.membership import Membership
from datachimp.serializers.project import ProjectSerializer
c... | 31.396226 | 102 | 0.772837 | from uuid import uuid4
from rest_framework import generics, status
from rest_framework.response import Response
from rest_framework.decorators import api_view
from datachimp.models.project import Project
from datachimp.models.membership import Membership
from datachimp.serializers.project import ProjectSerializer
c... | true | true |
f772287685aa0c44b735307fe50d53dd7811aea3 | 1,072 | py | Python | application1.py | mrjkhan/HelloWorld | 73b791588d4c1f2bff8dd735769f3f531715277c | [
"MIT"
] | null | null | null | application1.py | mrjkhan/HelloWorld | 73b791588d4c1f2bff8dd735769f3f531715277c | [
"MIT"
] | null | null | null | application1.py | mrjkhan/HelloWorld | 73b791588d4c1f2bff8dd735769f3f531715277c | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, jsonify, redirect
from flask import send_file
import pandas as pd
import json
import os.path
from os import path
import datetime
##additional imports
with open('./data/users.json') as json_data:
users = json.load(json_data)
app = Flask(__name__)
####func... | 23.304348 | 74 | 0.63153 | from flask import Flask, render_template, request, jsonify, redirect
from flask import send_file
import pandas as pd
import json
import os.path
from os import path
import datetime
with open('./data/users.json') as json_data:
users = json.load(json_data)
app = Flask(__name__)
@app.route('/', methods=['... | true | true |
f7722972ed0bb2352d852f90d7df846900c06e03 | 9,788 | py | Python | doc/usage/extensions/example_numpy.py | daobook/sphinx | ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe | [
"BSD-2-Clause"
] | null | null | null | doc/usage/extensions/example_numpy.py | daobook/sphinx | ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe | [
"BSD-2-Clause"
] | null | null | null | doc/usage/extensions/example_numpy.py | daobook/sphinx | ef8daca1f9a82ede9b4b0b5cde93f3414cee3dfe | [
"BSD-2-Clause"
] | null | null | null | """Example NumPy style docstrings.
This module demonstrates documentation as specified by the `NumPy
Documentation HOWTO`_. Docstrings may extend over multiple lines. Sections
are created with a section header followed by an underline of equal length.
Example
-------
Examples can be given using either the ``Example``... | 27.494382 | 78 | 0.644769 |
module_level_variable1 = 12345
module_level_variable2 = 98765
def function_with_types_in_docstring(param1, param2):
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
def module_level_function(param1, param2=None, *args, **kwargs):
if param1 == param2:
raise ValueError('par... | true | true |
f77229811607213ec1e163b2f4f87ec81c2a9314 | 2,001 | py | Python | scipy/special/_precompute/lambertw.py | daniel-dr-rojas/scipy | 8e418e38fe6c88105eeae8eeb53248d19a8286fb | [
"BSD-3-Clause"
] | 1 | 2020-04-09T06:22:21.000Z | 2020-04-09T06:22:21.000Z | scipy/special/_precompute/lambertw.py | daniel-dr-rojas/scipy | 8e418e38fe6c88105eeae8eeb53248d19a8286fb | [
"BSD-3-Clause"
] | null | null | null | scipy/special/_precompute/lambertw.py | daniel-dr-rojas/scipy | 8e418e38fe6c88105eeae8eeb53248d19a8286fb | [
"BSD-3-Clause"
] | null | null | null | """Compute a Pade approximation for the principle branch of the
Lambert W function around 0 and compare it to various other
approximations.
"""
import numpy as np
try:
import mpmath # type: ignore[import]
import matplotlib.pyplot as plt
except ImportError:
pass
def lambertw_pade():
derivs = [mpmath... | 29 | 69 | 0.617691 | import numpy as np
try:
import mpmath import matplotlib.pyplot as plt
except ImportError:
pass
def lambertw_pade():
derivs = [mpmath.diff(mpmath.lambertw, 0, n=n) for n in range(6)]
p, q = mpmath.pade(derivs, 3, 2)
return p, q
def main():
print(__doc__)
with mpmath.workdps(50):
... | true | true |
f77229e858d412e6f308600f7428106363515397 | 1,460 | py | Python | azure-servicefabric/azure/servicefabric/models/node_upgrade_progress_info.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-servicefabric/azure/servicefabric/models/node_upgrade_progress_info.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-servicefabric/azure/servicefabric/models/node_upgrade_progress_info.py | SUSE/azure-sdk-for-python | 324f99d26dd6f4ee9793b9bf1d4d5f928e4b6c2f | [
"MIT"
] | 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 ... | 38.421053 | 96 | 0.641096 |
from msrest.serialization import Model
class NodeUpgradeProgressInfo(Model):
_attribute_map = {
'node_name': {'key': 'NodeName', 'type': 'str'},
'upgrade_phase': {'key': 'UpgradePhase', 'type': 'str'},
'pending_safety_checks': {'key': 'PendingSafetyChecks', 'type': '[SafetyCheckWrapper]'... | true | true |
f7722a1276a3fc40ecf79e6c95ea88f1c17c0abd | 15,319 | py | Python | covid/harvester/harvester_api.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 14 | 2021-07-28T09:56:07.000Z | 2022-02-09T04:28:14.000Z | covid/harvester/harvester_api.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 23 | 2021-07-28T10:16:56.000Z | 2022-03-26T10:43:53.000Z | covid/harvester/harvester_api.py | pinksheetscrypto/covid-blockchain | 6360f93be99129898d349a3ad8414069c567988c | [
"Apache-2.0"
] | 9 | 2021-07-28T02:41:24.000Z | 2022-03-15T08:32:49.000Z | import asyncio
import time
from pathlib import Path
from typing import Callable, List, Tuple
from blspy import AugSchemeMPL, G2Element, G1Element
from covid.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from covid.harvester.harvester import Harvester
from covid.plotting.uti... | 49.257235 | 117 | 0.583002 | import asyncio
import time
from pathlib import Path
from typing import Callable, List, Tuple
from blspy import AugSchemeMPL, G2Element, G1Element
from covid.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters
from covid.harvester.harvester import Harvester
from covid.plotting.uti... | true | true |
f7722a9282a4e77ff2b5a4f244d883ec7ec11e4c | 7,324 | py | Python | wagtail/wagtaildocs/views/documents.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | 3 | 2016-08-17T13:56:36.000Z | 2019-04-23T19:59:25.000Z | wagtail/wagtaildocs/views/documents.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | 11 | 2016-08-05T15:43:06.000Z | 2016-12-16T13:32:23.000Z | wagtail/wagtaildocs/views/documents.py | Girbons/wagtail | 8a055addad739ff73f6e84ba553b28389122299f | [
"BSD-3-Clause"
] | 2 | 2017-08-08T01:39:02.000Z | 2018-05-06T06:16:10.000Z | from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from wagtail.utils.pagination import pagina... | 35.381643 | 97 | 0.664255 | from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext as _
from django.views.decorators.vary import vary_on_headers
from wagtail.utils.pagination import pagina... | true | true |
f7722b5cf721277409bb00176a259bb03922f5b7 | 2,596 | py | Python | get_equivalent_letter.py | yanyuliren/tt | e7e5ece9aeec6cee9f9bc1194dcfdfd42d9d63d3 | [
"MIT"
] | 58 | 2018-11-16T18:33:36.000Z | 2022-03-21T10:25:01.000Z | get_equivalent_letter.py | yanyuliren/tt | e7e5ece9aeec6cee9f9bc1194dcfdfd42d9d63d3 | [
"MIT"
] | 14 | 2018-11-16T18:29:56.000Z | 2020-01-31T10:15:46.000Z | get_equivalent_letter.py | roshniRam/Printed_text_recognition_and_conversion | a6885a4128a4992ef8a905d27790efa67023063f | [
"MIT"
] | 29 | 2018-11-16T18:51:46.000Z | 2022-01-03T22:04:16.000Z | #returns the equivalent letter output from neural network output node number
def get_letter(netnumber):
if netnumber == 0:
return "0"
if netnumber == 1:
return "1"
if netnumber == 2:
return "2"
if netnumber == 3:
return "3"
if netnumber == 4:
return "4"
if netnumber == 5:
return "5"
... | 18.28169 | 77 | 0.55547 |
def get_letter(netnumber):
if netnumber == 0:
return "0"
if netnumber == 1:
return "1"
if netnumber == 2:
return "2"
if netnumber == 3:
return "3"
if netnumber == 4:
return "4"
if netnumber == 5:
return "5"
if netnumber == 6:
return "6"
if netnumber == 7:
return "7"
if netn... | true | true |
f7722bce559b7a2f41b26008718873827a110675 | 1,170 | py | Python | accounts/forms.py | NewtonHead/e-commerce_project | 5ed448b033cd3771fc63f62022fe84ac8e17442d | [
"MIT"
] | null | null | null | accounts/forms.py | NewtonHead/e-commerce_project | 5ed448b033cd3771fc63f62022fe84ac8e17442d | [
"MIT"
] | null | null | null | accounts/forms.py | NewtonHead/e-commerce_project | 5ed448b033cd3771fc63f62022fe84ac8e17442d | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class RegisterUserForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
username = forms.CharField(required=... | 40.344828 | 98 | 0.617949 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
class RegisterUserForm(UserCreationForm):
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
username = forms.CharField(required=... | true | true |
f7722c26fb25c0ddcb2e4690da163aa795c2136f | 3,678 | py | Python | run_ssd_live_demo.py | RomanLevkovych/pytorch-ssd | 0d3d2621b8eeacdc6c1bd5ef62a65647ea401e0c | [
"MIT"
] | null | null | null | run_ssd_live_demo.py | RomanLevkovych/pytorch-ssd | 0d3d2621b8eeacdc6c1bd5ef62a65647ea401e0c | [
"MIT"
] | null | null | null | run_ssd_live_demo.py | RomanLevkovych/pytorch-ssd | 0d3d2621b8eeacdc6c1bd5ef62a65647ea401e0c | [
"MIT"
] | null | null | null | from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.squeezenet_ssd_lite impor... | 41.325843 | 112 | 0.710984 | from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.squeezenet_ssd_lite impor... | true | true |
f7722d4e826390a3c2b701b8db339b46c09127d9 | 869 | py | Python | Problemset/reverse-nodes-in-k-group/reverse-nodes-in-k-group.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 1 | 2021-01-30T01:52:46.000Z | 2021-01-30T01:52:46.000Z | Problemset/reverse-nodes-in-k-group/reverse-nodes-in-k-group.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 1 | 2021-12-15T14:54:06.000Z | 2021-12-15T14:54:06.000Z | Problemset/reverse-nodes-in-k-group/reverse-nodes-in-k-group.py | worldwonderer/algorithm | 083178b2d987de7f6020aceca869a353c0b4b1f3 | [
"MIT"
] | 2 | 2021-04-19T03:32:18.000Z | 2021-06-22T07:06:01.000Z |
# @Title: K 个一组翻转链表 (Reverse Nodes in k-Group)
# @Author: 18015528893
# @Date: 2021-02-19 22:23:56
# @Runtime: 48 ms
# @Memory: 15.6 MB
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverse... | 23.486486 | 64 | 0.491369 |
class Solution:
def reverseKGroup(self, head: ListNode, k: int) -> ListNode:
if head is None:
return
a = b = head
for i in range(k):
if b is None: return head
b = b.next
def reverse(a, b):
pre = None
cur = a
... | true | true |
f7722d4ec0e7275b82b33e3dee2fe5809541c89b | 3,159 | py | Python | my_models/lenet.py | biechuyangwang/paddle_practice | 80c36bf4110bd62157ef6bfacd7cf55246e08d63 | [
"Apache-2.0"
] | null | null | null | my_models/lenet.py | biechuyangwang/paddle_practice | 80c36bf4110bd62157ef6bfacd7cf55246e08d63 | [
"Apache-2.0"
] | null | null | null | my_models/lenet.py | biechuyangwang/paddle_practice | 80c36bf4110bd62157ef6bfacd7cf55246e08d63 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# 导入需要的包
import paddle
import numpy as np
from paddle.nn import Conv2D, MaxPool2D, Linear, Dropout
import paddle.nn.functional as F
# 定义 LeNet 网络结构
class LeNet(paddle.nn.Layer):
def __init__(self, num_classes=1):
super(LeNet, self).__init__()
# 创建卷积和池化层块,每个卷积层使用Sigmoid激活函数,... | 42.12 | 129 | 0.502374 |
import paddle
import numpy as np
from paddle.nn import Conv2D, MaxPool2D, Linear, Dropout
import paddle.nn.functional as F
class LeNet(paddle.nn.Layer):
def __init__(self, num_classes=1):
super(LeNet, self).__init__()
self.conv1 = Conv2D(in_channels=3, out_channels=6, kernel_size=5) ... | true | true |
f77230607801f8453860087c353b0efacc7eea30 | 33,376 | py | Python | pyquaternion/test/test_quaternion.py | alexpyattaev/pyquaternion | 19c3581799c220607ce327af5f1cbe9f98dba4e6 | [
"MIT"
] | null | null | null | pyquaternion/test/test_quaternion.py | alexpyattaev/pyquaternion | 19c3581799c220607ce327af5f1cbe9f98dba4e6 | [
"MIT"
] | null | null | null | pyquaternion/test/test_quaternion.py | alexpyattaev/pyquaternion | 19c3581799c220607ce327af5f1cbe9f98dba4e6 | [
"MIT"
] | null | null | null | #!/usr/bin python
# -*- coding: utf-8 -*-
"""
This file is part of the pyquaternion python module
Author: Kieran Wynn
Website: https://github.com/KieranWynn/pyquaternion
Documentation: http://kieranwynn.github.io/pyquaternion/
Version: 1.0.0
License: The MIT License (MIT)
Copyright (c... | 35.058824 | 118 | 0.587518 |
import unittest
from math import pi, sin, cos
from random import random
import numpy as np
import pytest
import pyquaternion
from pyquaternion.numba_opt import TypingError
from pyquaternion.quaternion import z_axis, x_axis, to_str
Quaternion = pyquaternion.Quaternion
ALMOST_EQUAL_TOLERANCE = 13
def randomElement... | true | true |
f77231222b4f875ba9b4bb94c930c00431d92009 | 957 | py | Python | Python/lonely-pixel-i.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/lonely-pixel-i.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/lonely-pixel-i.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | # Time: O(m * n)
# Space: O(m + n)
class Solution(object):
def findLonelyPixel(self, picture):
"""
:type picture: List[List[str]]
:rtype: int
"""
rows, cols = [0] * len(picture), [0] * len(picture[0])
for i in range(len(picture)):
for j in range(len(pic... | 27.342857 | 78 | 0.451411 |
class Solution(object):
def findLonelyPixel(self, picture):
rows, cols = [0] * len(picture), [0] * len(picture[0])
for i in range(len(picture)):
for j in range(len(picture[0])):
if picture[i][j] == 'B':
rows[i] += 1
cols[j] += 1
... | true | true |
f7723156826c9cd2bd21d07634a8a5ccc173e2b7 | 4,758 | py | Python | GenerateDatabase.py | prajwal309/HAPILite_Modified | e0527328569ef8bd576114b1619ac5c87ff8c5b2 | [
"MIT"
] | null | null | null | GenerateDatabase.py | prajwal309/HAPILite_Modified | e0527328569ef8bd576114b1619ac5c87ff8c5b2 | [
"MIT"
] | null | null | null | GenerateDatabase.py | prajwal309/HAPILite_Modified | e0527328569ef8bd576114b1619ac5c87ff8c5b2 | [
"MIT"
] | null | null | null | import glob
import numpy as np
from lib.CrossSectionFunctions import GetWaveNumbers, BinModel
import matplotlib.pyplot as plt
import os
import itertools
import time
import multiprocessing as mp
#parse the parameters.ini which contains the information
Data = [f.split(":") for f in open("CrossSectionParams/Parameters.in... | 39.322314 | 147 | 0.666877 | import glob
import numpy as np
from lib.CrossSectionFunctions import GetWaveNumbers, BinModel
import matplotlib.pyplot as plt
import os
import itertools
import time
import multiprocessing as mp
Data = [f.split(":") for f in open("CrossSectionParams/Parameters.ini",'r+')][1:]
Values = [Item[1].split("#")[0] for Item in... | true | true |
f772322fa76730edf698fbbc7593de3dc1007eeb | 13,660 | py | Python | DP/Server/DataManager.py | thomson-greg/XBOS-DR | 9c55b9022f41bf497a1cebb25a154e5d0ab2b547 | [
"Apache-2.0"
] | null | null | null | DP/Server/DataManager.py | thomson-greg/XBOS-DR | 9c55b9022f41bf497a1cebb25a154e5d0ab2b547 | [
"Apache-2.0"
] | null | null | null | DP/Server/DataManager.py | thomson-greg/XBOS-DR | 9c55b9022f41bf497a1cebb25a154e5d0ab2b547 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
import os
from datetime import timedelta
import pandas as pd
import pytz
import requests
import yaml
from xbos import get_client
from xbos.services import mdal
from xbos.services.hod import HodClient
# TODO add energy data acquisition
# TODO FIX DAYLIGHT TIME CHANGE PROBLEMS
# util funct... | 41.393939 | 143 | 0.55571 | import datetime
import json
import os
from datetime import timedelta
import pandas as pd
import pytz
import requests
import yaml
from xbos import get_client
from xbos.services import mdal
from xbos.services.hod import HodClient
def getDatetime(date_string):
"""Gets datetime from string with format HH:MM.
:p... | false | true |
f77232ae568c6509601b27973e8cac66fb3ada28 | 2,705 | py | Python | arviz/plots/backends/bokeh/bokeh_violinplot.py | anzelpwj/arviz | 3aba6c9d1831199631a8e48ecc82ed482bdf00e8 | [
"Apache-2.0"
] | null | null | null | arviz/plots/backends/bokeh/bokeh_violinplot.py | anzelpwj/arviz | 3aba6c9d1831199631a8e48ecc82ed482bdf00e8 | [
"Apache-2.0"
] | null | null | null | arviz/plots/backends/bokeh/bokeh_violinplot.py | anzelpwj/arviz | 3aba6c9d1831199631a8e48ecc82ed482bdf00e8 | [
"Apache-2.0"
] | null | null | null | """Bokeh Violinplot."""
import bokeh.plotting as bkp
from bokeh.layouts import gridplot
from bokeh.models.annotations import Title
import numpy as np
from ....stats import hpd
from ....stats.stats_utils import histogram
from ...kdeplot import _fast_kde
from ...plot_utils import get_bins, make_label, _create_axes_grid
... | 26.519608 | 83 | 0.605915 | import bokeh.plotting as bkp
from bokeh.layouts import gridplot
from bokeh.models.annotations import Title
import numpy as np
from ....stats import hpd
from ....stats.stats_utils import histogram
from ...kdeplot import _fast_kde
from ...plot_utils import get_bins, make_label, _create_axes_grid
def _plot_violin(
... | true | true |
f77232ea9c56728206dd604fc31418d59365ff76 | 1,544 | py | Python | recognize_local.py | Suchbear/cnn_captcha | beafacd51248648698ba0b2136c216088588f7e2 | [
"Apache-2.0"
] | null | null | null | recognize_local.py | Suchbear/cnn_captcha | beafacd51248648698ba0b2136c216088588f7e2 | [
"Apache-2.0"
] | null | null | null | recognize_local.py | Suchbear/cnn_captcha | beafacd51248648698ba0b2136c216088588f7e2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
使用自建的接口识别来自网络的验证码
需要配置参数:
remote_url = "https://www.xxxxxxx.com/getImg" 验证码链接地址
rec_times = 1 识别的次数
"""
import datetime
import requests
from io import BytesIO
import time
import json
import os
def recognize_captcha(test_path, save_path, image_suffix):
image_... | 26.169492 | 95 | 0.623705 | import datetime
import requests
from io import BytesIO
import time
import json
import os
def recognize_captcha(test_path, save_path, image_suffix):
image_file_name = 'captcha.{}'.format(image_suffix)
with open(test_path, "rb") as f:
content = f.read()
s = time.time()
url = "http://127.0.... | true | true |
f77233d8ed7d0bb6591f06b55baa91199db49c2e | 2,018 | py | Python | examples/pyclient_mnist.py | jopasserat/he-transformer | d2865be507d2e20568ca5289513925c813aa59e6 | [
"Apache-2.0"
] | null | null | null | examples/pyclient_mnist.py | jopasserat/he-transformer | d2865be507d2e20568ca5289513925c813aa59e6 | [
"Apache-2.0"
] | null | null | null | examples/pyclient_mnist.py | jopasserat/he-transformer | d2865be507d2e20568ca5289513925c813aa59e6 | [
"Apache-2.0"
] | null | null | null | import time
import argparse
import numpy as np
import sys
import os
from tensorflow.examples.tutorials.mnist import input_data
import he_seal_client
FLAGS = None
def test_mnist_cnn(FLAGS):
mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=True)
batch_size = FLAGS.batch_size
x_test_batch = mnist.... | 27.643836 | 79 | 0.695738 | import time
import argparse
import numpy as np
import sys
import os
from tensorflow.examples.tutorials.mnist import input_data
import he_seal_client
FLAGS = None
def test_mnist_cnn(FLAGS):
mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=True)
batch_size = FLAGS.batch_size
x_test_batch = mnist.... | true | true |
f7723412abf2e3bf0c45305e1282b4a2d032112d | 11,832 | py | Python | tensorflow/python/autograph/pyct/ast_util.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 5 | 2019-01-13T16:15:25.000Z | 2019-07-07T16:17:32.000Z | tensorflow/python/autograph/pyct/ast_util.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 1 | 2019-07-27T16:45:02.000Z | 2019-07-27T16:45:02.000Z | tensorflow/python/autograph/pyct/ast_util.py | ajweiss/tensorflow | 2f4d4da52f0c488417d7e917edaf1b7569b5e408 | [
"Apache-2.0"
] | 2 | 2018-12-20T17:53:37.000Z | 2018-12-27T18:49:13.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 29.142857 | 80 | 0.664723 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ast
import gast
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.autograph.pyct import parser
from tensorflow.python.util import tf_inspect
class CleanCopier(object):
def ... | true | true |
f77234468ac8912af60e83157abb1b823a89bd28 | 1,353 | py | Python | tests/unit/test_wait_for_path_to_exist.py | JoshKarpel/condormap | c742eb791bdc8c100cb103177751a95f21369c28 | [
"Apache-2.0"
] | 21 | 2018-11-28T23:59:18.000Z | 2021-11-16T20:09:27.000Z | tests/unit/test_wait_for_path_to_exist.py | JoshKarpel/condormap | c742eb791bdc8c100cb103177751a95f21369c28 | [
"Apache-2.0"
] | 184 | 2018-09-24T03:30:19.000Z | 2021-06-29T01:01:34.000Z | tests/unit/test_wait_for_path_to_exist.py | JoshKarpel/condormap | c742eb791bdc8c100cb103177751a95f21369c28 | [
"Apache-2.0"
] | 6 | 2019-08-08T19:38:22.000Z | 2021-09-05T05:39:49.000Z | # Copyright 2018 HTCondor Team, Computer Sciences Department,
# University of Wisconsin-Madison, WI.
#
# 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/LICE... | 30.75 | 94 | 0.756098 |
from datetime import timedelta
from pathlib import Path
import pytest
import htmap
from htmap.utils import timeout_to_seconds, wait_for_path_to_exist
def test_returns_when_path_does_exist():
path = Path(__file__)
wait_for_path_to_exist(path)
@pytest.mark.parametrize("timeout", [0, -1])
def test_timeout_... | true | true |
f7723469a949ffa78524cf6790ef23636fc3a90a | 1,393 | py | Python | froide_campaign/urls.py | krmax44/froide-campaign | 7f3a318fbd194dfd7b3560bb877a64e8c1dfd814 | [
"MIT"
] | null | null | null | froide_campaign/urls.py | krmax44/froide-campaign | 7f3a318fbd194dfd7b3560bb877a64e8c1dfd814 | [
"MIT"
] | null | null | null | froide_campaign/urls.py | krmax44/froide-campaign | 7f3a318fbd194dfd7b3560bb877a64e8c1dfd814 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from froide.helper import api_router
from .views import (
index, campaign_page,
CampaignPageListView, CampaignPageEditView, AssignCampaignPageTeamView,
CampaignPageEmbedView, CampaignPageUpdateEmbedView,
redirect_to_make_request, CampaignStatistics
)
from .api_views im... | 35.717949 | 78 | 0.67552 | from django.conf.urls import url
from froide.helper import api_router
from .views import (
index, campaign_page,
CampaignPageListView, CampaignPageEditView, AssignCampaignPageTeamView,
CampaignPageEmbedView, CampaignPageUpdateEmbedView,
redirect_to_make_request, CampaignStatistics
)
from .api_views im... | true | true |
f77234738ca6e6170ac6c850f4f3de69910bd381 | 6,258 | py | Python | Maintain Median with Heap/maintain_median_heap.py | liu-yunpeng/algorithms | 1bbe34b4a3d2f090007faec25220ac8535213da7 | [
"MIT"
] | 3 | 2021-04-24T01:20:27.000Z | 2021-04-24T20:39:27.000Z | Maintain Median with Heap/maintain_median_heap.py | liu-yunpeng/algorithms | 1bbe34b4a3d2f090007faec25220ac8535213da7 | [
"MIT"
] | null | null | null | Maintain Median with Heap/maintain_median_heap.py | liu-yunpeng/algorithms | 1bbe34b4a3d2f090007faec25220ac8535213da7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Yunpeng Liu
"""
input_file = r"~\input.txt"
with open(input_file, 'r') as f:
input_data = []
for line in f:
input_data.append(int(line))
#input_data = input_data[:10]
print(input_data)
class Heap(object):
def __init__(self, array = []):
... | 26.858369 | 97 | 0.520134 |
input_file = r"~\input.txt"
with open(input_file, 'r') as f:
input_data = []
for line in f:
input_data.append(int(line))
print(input_data)
class Heap(object):
def __init__(self, array = []):
self.array = array
def insert(self, value):
pass
... | true | true |
f77234cc50d4f864f4bcc3983bf7f6cf6aacee3f | 7,780 | py | Python | export_to_tfhub.py | ivis-kuwata/albert | bd336ba2d324bb35b9d09599da3d635895bac379 | [
"Apache-2.0"
] | 1,846 | 2019-11-26T22:25:45.000Z | 2020-03-23T12:37:09.000Z | export_to_tfhub.py | ivis-kuwata/albert | bd336ba2d324bb35b9d09599da3d635895bac379 | [
"Apache-2.0"
] | 140 | 2019-12-07T02:48:27.000Z | 2020-03-22T11:01:21.000Z | export_to_tfhub.py | ivis-kuwata/albert | bd336ba2d324bb35b9d09599da3d635895bac379 | [
"Apache-2.0"
] | 296 | 2020-03-24T10:05:43.000Z | 2022-03-24T11:17:37.000Z | # coding=utf-8
# Copyright 2018 The Google AI Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 37.403846 | 79 | 0.727506 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
from albert import modeling
import tensorflow.compat.v1 as tf
import tensorflow_hub as hub
flags.DEFINE_string(
"albert_directory", None,
"The conf... | true | true |
f77235385ae3cfdcdd9752e812ca67bedbb11408 | 1,041 | py | Python | stormspans/variables.py | runfalk/stormspans | eb102848b881305816ba3bce9757126af3c6d6a4 | [
"MIT"
] | 1 | 2019-06-22T21:45:39.000Z | 2019-06-22T21:45:39.000Z | stormspans/variables.py | runfalk/stormspans | eb102848b881305816ba3bce9757126af3c6d6a4 | [
"MIT"
] | null | null | null | stormspans/variables.py | runfalk/stormspans | eb102848b881305816ba3bce9757126af3c6d6a4 | [
"MIT"
] | 2 | 2016-01-04T15:49:25.000Z | 2022-02-21T16:57:10.000Z | from storm.variables import Variable
from spans import *
__all__ = [
"RangeVariable",
"IntRangeVariable",
"FloatRangeVariable",
"DateRangeVariable",
"DateTimeRangeVariable"
]
class RangeVariable(Variable):
"""
Extension of standard variable class to handle conversion to and from Psycopg2
... | 24.209302 | 82 | 0.682997 | from storm.variables import Variable
from spans import *
__all__ = [
"RangeVariable",
"IntRangeVariable",
"FloatRangeVariable",
"DateRangeVariable",
"DateTimeRangeVariable"
]
class RangeVariable(Variable):
def parse_set(self, value, from_db):
if not isinstance(value, self.range_type)... | true | true |
f772373c24adaf70aa5b221b329a7c067000ef0b | 40,023 | py | Python | trove/taskmanager/models.py | dadu1688/trove | efd0d647beea2ba492f77b3927d6d9e6396d9a76 | [
"Apache-2.0"
] | null | null | null | trove/taskmanager/models.py | dadu1688/trove | efd0d647beea2ba492f77b3927d6d9e6396d9a76 | [
"Apache-2.0"
] | null | null | null | trove/taskmanager/models.py | dadu1688/trove | efd0d647beea2ba492f77b3927d6d9e6396d9a76 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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 l... | 41.517635 | 79 | 0.59968 |
import traceback
import os.path
from cinderclient import exceptions as cinder_exceptions
from eventlet import greenthread
from novaclient import exceptions as nova_exceptions
from trove.common import cfg
from trove.common import template
from trove.common import utils
from trove.common.exception import GuestError
from... | true | true |
f77238618a2daa22abb83808c6c059cee2bbebc7 | 23,915 | py | Python | game/gamesrc/objects/world/items.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | game/gamesrc/objects/world/items.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | game/gamesrc/objects/world/items.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | import random
from ev import Object
from src.utils import utils
from prettytable import PrettyTable
class Item(Object):
"""
This is a default item object. This object is used as base for
all items in the game: armor, weapons, rings, trinkets, potions
etc. You get the idea
"""
def at_object_... | 47.544732 | 145 | 0.574409 | import random
from ev import Object
from src.utils import utils
from prettytable import PrettyTable
class Item(Object):
def at_object_creation(self):
self.db.desc = "A generic item, why it actually looks like...nothing at all"
blackhole = self.search("blackhole", global_search=True)
... | true | true |
f77238aee2143850334837cb5d491d0902dfa339 | 115 | py | Python | api/hooks/hook_set_updated_at.py | warezgibzzz/chat-app-backend | 6dabe3a861241c23fa565ee0f0d2520b526e472c | [
"MIT"
] | 1 | 2017-04-13T10:14:32.000Z | 2017-04-13T10:14:32.000Z | api/hooks/hook_set_updated_at.py | warezgibzzz/chat-app-backend | 6dabe3a861241c23fa565ee0f0d2520b526e472c | [
"MIT"
] | null | null | null | api/hooks/hook_set_updated_at.py | warezgibzzz/chat-app-backend | 6dabe3a861241c23fa565ee0f0d2520b526e472c | [
"MIT"
] | null | null | null | def set_updated_at(resource_name, updates, original):
print resource_name
print updates
print original
| 23 | 53 | 0.765217 | def set_updated_at(resource_name, updates, original):
print resource_name
print updates
print original
| false | true |
f77238e317633fad503f94d9e4c2af004f97ec25 | 166 | py | Python | Lib/Scripts/fonts/actions.py | gferreira/hTools2 | a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c | [
"BSD-3-Clause"
] | 11 | 2015-01-06T15:43:56.000Z | 2019-07-27T00:35:20.000Z | hTools2.roboFontExt/lib/Scripts/all fonts/actions.py | gferreira/hTools2_extension | 9e5150082a0a39847c1078aac3dc38d914a44f83 | [
"BSD-3-Clause"
] | 2 | 2017-08-08T21:02:17.000Z | 2019-12-18T15:55:48.000Z | Lib/Scripts/fonts/actions.py | gferreira/hTools2 | a75a671b81a0f4ce5c82b2ad3e2f971ca3e3d98c | [
"BSD-3-Clause"
] | 4 | 2015-01-10T13:58:50.000Z | 2019-12-18T15:40:14.000Z | # [h] transform all open fonts
import hTools2.dialogs.all_fonts.actions
reload(hTools2.dialogs.all_fonts.actions)
hTools2.dialogs.all_fonts.actions.actionsDialog()
| 23.714286 | 49 | 0.825301 |
import hTools2.dialogs.all_fonts.actions
reload(hTools2.dialogs.all_fonts.actions)
hTools2.dialogs.all_fonts.actions.actionsDialog()
| true | true |
f77239619a073c1545f48bbe40c974415f4d3763 | 228 | py | Python | kingfisher_scrapy/spiders/digiwhist_slovenia.py | spendnetwork/kingfisher-scrape | 053910b278eed9b3e79ca2f05a04086300b8bc21 | [
"BSD-3-Clause"
] | null | null | null | kingfisher_scrapy/spiders/digiwhist_slovenia.py | spendnetwork/kingfisher-scrape | 053910b278eed9b3e79ca2f05a04086300b8bc21 | [
"BSD-3-Clause"
] | null | null | null | kingfisher_scrapy/spiders/digiwhist_slovenia.py | spendnetwork/kingfisher-scrape | 053910b278eed9b3e79ca2f05a04086300b8bc21 | [
"BSD-3-Clause"
] | null | null | null | from kingfisher_scrapy.spiders.digiwhist_base import DigiwhistBase
class DigiwhistSloveniaRepublic(DigiwhistBase):
name = 'digiwhist_slovenia'
start_urls = ['https://opentender.eu/data/files/SI_ocds_data.json.tar.gz']
| 32.571429 | 78 | 0.802632 | from kingfisher_scrapy.spiders.digiwhist_base import DigiwhistBase
class DigiwhistSloveniaRepublic(DigiwhistBase):
name = 'digiwhist_slovenia'
start_urls = ['https://opentender.eu/data/files/SI_ocds_data.json.tar.gz']
| true | true |
f772399cf7459f5b58c8ffa216a6c037044851ed | 11,966 | py | Python | pytos/securechange/xml_objects/restapi/step/access_request/verifier.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 61 | 2017-03-27T07:06:54.000Z | 2022-03-02T12:13:00.000Z | pytos/securechange/xml_objects/restapi/step/access_request/verifier.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 38 | 2017-06-14T02:53:05.000Z | 2022-03-11T12:51:10.000Z | pytos/securechange/xml_objects/restapi/step/access_request/verifier.py | geewrd/pytos | 2379b3c61c47d03166638250a7622303e2a78a14 | [
"Apache-2.0"
] | 25 | 2017-07-10T18:08:14.000Z | 2021-12-30T22:01:01.000Z | from pytos.securechange.xml_objects.restapi.step.initialize import *
from pytos.securechange.xml_objects.restapi.step.step import AbsNetwork, AbsService, Binding
logger = logging.getLogger(XML_LOGGER_NAME)
class Analysis_Result(XML_Object_Base):
IMPLEMENTED = "implemented"
NOT_AVAILABLE = "not available"
... | 45.498099 | 120 | 0.675247 | from pytos.securechange.xml_objects.restapi.step.initialize import *
from pytos.securechange.xml_objects.restapi.step.step import AbsNetwork, AbsService, Binding
logger = logging.getLogger(XML_LOGGER_NAME)
class Analysis_Result(XML_Object_Base):
IMPLEMENTED = "implemented"
NOT_AVAILABLE = "not available"
... | true | true |
f7723a68aad61a9b7c22886e206caea61a0c71fe | 2,749 | py | Python | setup.py | farmafield-labs/django-forms-builder | 6166363c4de29c2c97ee890c0db394a7a51dc82f | [
"BSD-2-Clause"
] | null | null | null | setup.py | farmafield-labs/django-forms-builder | 6166363c4de29c2c97ee890c0db394a7a51dc82f | [
"BSD-2-Clause"
] | null | null | null | setup.py | farmafield-labs/django-forms-builder | 6166363c4de29c2c97ee890c0db394a7a51dc82f | [
"BSD-2-Clause"
] | null | null | null |
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages
exclude = ["forms_builder/example_project/dev.db",
"forms_builder/example_project/local_settings.py"]
exclude = dict([(e, None) for e in exclude])
for e in exclude:
if e.endswith(".py"):
try:
... | 33.120482 | 74 | 0.535104 |
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages
exclude = ["forms_builder/example_project/dev.db",
"forms_builder/example_project/local_settings.py"]
exclude = dict([(e, None) for e in exclude])
for e in exclude:
if e.endswith(".py"):
try:
... | true | true |
f7723b8bafd33bb6b62e3624a207e0ecc3d2216c | 13,890 | py | Python | couchdb_plugin.py | signalfx/collectd-couchdb | fb427811155d028cb956c661d78a370f1eb912ad | [
"Apache-2.0"
] | null | null | null | couchdb_plugin.py | signalfx/collectd-couchdb | fb427811155d028cb956c661d78a370f1eb912ad | [
"Apache-2.0"
] | null | null | null | couchdb_plugin.py | signalfx/collectd-couchdb | fb427811155d028cb956c661d78a370f1eb912ad | [
"Apache-2.0"
] | 2 | 2019-09-04T08:52:33.000Z | 2021-03-16T10:11:26.000Z | #!/usr/bin/python
import json
import logging
import sfx_collectd_utilities as sfx
import urllib2
import urllib_ssl_handler
import couchdb_metrics
import base64
import six
try:
import collectd
except ImportError:
try:
import dummy_collectd as collectd
except ImportError:
pass
# Plugin name... | 39.126761 | 117 | 0.581497 |
import json
import logging
import sfx_collectd_utilities as sfx
import urllib2
import urllib_ssl_handler
import couchdb_metrics
import base64
import six
try:
import collectd
except ImportError:
try:
import dummy_collectd as collectd
except ImportError:
pass
PLUGIN_NAME = 'couchdb'
def m... | true | true |
f7723bc6cf594612e56bd85ebccdbe73cb83355f | 611 | py | Python | manage.py | deven96/imageQ | 56c92072075e3d5c4310665702489f8ebfd3922d | [
"MIT"
] | 2 | 2018-12-27T10:15:17.000Z | 2018-12-31T11:33:05.000Z | manage.py | deven96/imageQ | 56c92072075e3d5c4310665702489f8ebfd3922d | [
"MIT"
] | null | null | null | manage.py | deven96/imageQ | 56c92072075e3d5c4310665702489f8ebfd3922d | [
"MIT"
] | 1 | 2020-06-17T18:01:25.000Z | 2020-06-17T18:01:25.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
if not os.environ.get('DJANGO_SETTINGS_MODULE'):
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ImageQ.settings.local_settings')
try:
from django.core.management import execute_from_command_line
except ImportError as e... | 33.944444 | 89 | 0.690671 | import os
import sys
if __name__ == '__main__':
if not os.environ.get('DJANGO_SETTINGS_MODULE'):
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ImageQ.settings.local_settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | true | true |
f7723bee532ff4b0bed675d373635ebde82bc871 | 20,960 | py | Python | .venv/lib/python3.8/site-packages/pandas/core/reshape/tile.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 115 | 2020-06-18T15:00:58.000Z | 2022-03-02T10:13:19.000Z | .venv/lib/python3.8/site-packages/pandas/core/reshape/tile.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 21 | 2021-04-13T01:17:40.000Z | 2022-03-11T16:06:50.000Z | .venv/lib/python3.8/site-packages/pandas/core/reshape/tile.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 60 | 2020-07-22T14:53:10.000Z | 2022-03-23T10:17:59.000Z | """
Quantilization functions and related stuff
"""
import numpy as np
from pandas._libs import Timedelta, Timestamp
from pandas._libs.lib import infer_dtype
from pandas.core.dtypes.common import (
DT64NS_DTYPE,
ensure_int64,
is_bool_dtype,
is_categorical_dtype,
is_datetime64_dtype,
is_datetime... | 33.482428 | 104 | 0.60792 | import numpy as np
from pandas._libs import Timedelta, Timestamp
from pandas._libs.lib import infer_dtype
from pandas.core.dtypes.common import (
DT64NS_DTYPE,
ensure_int64,
is_bool_dtype,
is_categorical_dtype,
is_datetime64_dtype,
is_datetime64tz_dtype,
is_datetime_or_timedelta_dtype,
... | true | true |
f7723c73d53c0c46285e05e55bb97cac84d240d3 | 4,795 | py | Python | tests/components/ambiclimate/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 1 | 2020-04-30T04:58:17.000Z | 2020-04-30T04:58:17.000Z | tests/components/ambiclimate/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 45 | 2020-07-23T17:47:56.000Z | 2022-03-31T06:02:00.000Z | tests/components/ambiclimate/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | null | null | null | """Tests for the Ambiclimate config flow."""
import ambiclimate
from homeassistant import data_entry_flow
from homeassistant.components.ambiclimate import config_flow
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.setup import async_setup_component
from homeassistant.util import ... | 37.460938 | 85 | 0.72513 | import ambiclimate
from homeassistant import data_entry_flow
from homeassistant.components.ambiclimate import config_flow
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.setup import async_setup_component
from homeassistant.util import aiohttp
from tests.async_mock import AsyncMo... | true | true |
f7723d03c86887ce08b5ccbb1e58305ca263a701 | 4,762 | py | Python | src/global_stat.py | volovodenko/English | 860ae0f971909b9aa299c193ea7d0161c88d0b22 | [
"Apache-2.0"
] | 31 | 2015-02-11T16:10:52.000Z | 2021-08-31T12:39:05.000Z | src/global_stat.py | volovodenko/English | 860ae0f971909b9aa299c193ea7d0161c88d0b22 | [
"Apache-2.0"
] | 5 | 2015-05-26T09:38:02.000Z | 2015-11-12T20:54:32.000Z | src/global_stat.py | volovodenko/English | 860ae0f971909b9aa299c193ea7d0161c88d0b22 | [
"Apache-2.0"
] | 9 | 2015-03-18T08:23:51.000Z | 2022-01-05T05:51:04.000Z | # -*- coding: utf-8 -*-
import unittest
class GlobalStatistic:
"Расчет данных для отображения статистики пользователю"
def __init__(self):
self.stat_en_ru = []
self.stat_ru_en = []
def _calc_stat(self, word, stat_info):
en_word, transcription, ru_word = word.get_show_info()
... | 39.032787 | 108 | 0.603948 |
import unittest
class GlobalStatistic:
def __init__(self):
self.stat_en_ru = []
self.stat_ru_en = []
def _calc_stat(self, word, stat_info):
en_word, transcription, ru_word = word.get_show_info()
total = stat_info.get_total_answer()
success_cnt = stat_info.get_success... | true | true |
f7723d117ce5331e22ac5a1032e97f7474e4f6f3 | 2,584 | py | Python | data/p4VQE/R4/benchmark/startQiskit_QC575.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC575.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC575.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=13
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.784946 | 118 | 0.637384 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.