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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76b1865a954b1ec13073cb8435d0add27f6f275 | 6,683 | py | Python | utils.py | marcokome/CoAP2-Python | 5f03b642c1b66781c0dd14b4c30e3baf58bb8a33 | [
"MIT"
] | 1 | 2020-09-05T18:26:48.000Z | 2020-09-05T18:26:48.000Z | utils.py | marcokome/CoAP2-Python | 5f03b642c1b66781c0dd14b4c30e3baf58bb8a33 | [
"MIT"
] | null | null | null | utils.py | marcokome/CoAP2-Python | 5f03b642c1b66781c0dd14b4c30e3baf58bb8a33 | [
"MIT"
] | null | null | null |
import parameters, socket, time, yaml
from Message import Message
'''
Utils functions
'''
# Default callback function for the discovery
def default_discovery_callback(**res):
print("**Default discovery callback:")
print("---------------------------------")
print("ip:{},\nhn:{},\nrs:{}".format(res["ip"],... | 32.759804 | 105 | 0.5716 |
import parameters, socket, time, yaml
from Message import Message
def default_discovery_callback(**res):
print("**Default discovery callback:")
print("---------------------------------")
print("ip:{},\nhn:{},\nrs:{}".format(res["ip"], res["hn"], res["rs"]))
print("---------------------------------"... | true | true |
f76b18fe2bca15dc738254aa72b4ef3f873a5607 | 11,716 | py | Python | sdks/python/client/argo_workflows/model/io_argoproj_workflow_v1alpha1_workflow_watch_event.py | roofurmston/argo-workflows | 79a95f223396ecab408d831781ab2d38d1fa6de0 | [
"Apache-2.0"
] | 7,643 | 2017-08-22T22:10:45.000Z | 2021-02-09T17:13:12.000Z | sdks/python/client/argo_workflows/model/io_argoproj_workflow_v1alpha1_workflow_watch_event.py | roofurmston/argo-workflows | 79a95f223396ecab408d831781ab2d38d1fa6de0 | [
"Apache-2.0"
] | 4,183 | 2017-08-22T22:45:29.000Z | 2021-02-09T17:41:29.000Z | sdks/python/client/argo_workflows/model/io_argoproj_workflow_v1alpha1_workflow_watch_event.py | isubasinghe/argo-workflows | 1a6e94f1d490e2265c977514d698a1ca70e14fe3 | [
"Apache-2.0"
] | 1,524 | 2017-08-22T22:10:53.000Z | 2021-02-09T16:26:16.000Z | """
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from ... | 44.045113 | 134 | 0.579891 |
import re import sys
from argo_workflows.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from .... | true | true |
f76b194bf36f2fb55904921cde4b078f3c68cca8 | 766 | py | Python | sampleCode/broadcastsender.py | Dustin-dusTir/distributed-systems-game | d4885385f961c3040c1ace9a17959e78a957ee72 | [
"MIT"
] | 6 | 2021-04-19T13:46:22.000Z | 2022-01-06T14:06:19.000Z | sampleCode/broadcastsender.py | Dustin-dusTir/Python-Projekt-Setup | d774478d6a93a5a4d961f4980438a24619245687 | [
"MIT"
] | null | null | null | sampleCode/broadcastsender.py | Dustin-dusTir/Python-Projekt-Setup | d774478d6a93a5a4d961f4980438a24619245687 | [
"MIT"
] | null | null | null | import socket
import ipaddress
def broadcast(ip, port, broadcast_message):
# Create a UDP socket
broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Send message on broadcast address
broadcast_socket.sendto(str.encode(broadcast_message), (ip, port))
broadcast_socket.clos... | 33.304348 | 80 | 0.721932 | import socket
import ipaddress
def broadcast(ip, port, broadcast_message):
broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
broadcast_socket.sendto(str.encode(broadcast_message), (ip, port))
broadcast_socket.close()
if __name__ == '__main__':
SUBNETMASK = "255.2... | true | true |
f76b1965ee7c58745b1db478719c9072d749ebad | 5,427 | py | Python | fastapi_awesome/security.py | curtkim/fastapi-awesome | c710d608bdb122a75fbdb7cc043c5aa4459f6102 | [
"Unlicense"
] | null | null | null | fastapi_awesome/security.py | curtkim/fastapi-awesome | c710d608bdb122a75fbdb7cc043c5aa4459f6102 | [
"Unlicense"
] | null | null | null | fastapi_awesome/security.py | curtkim/fastapi-awesome | c710d608bdb122a75fbdb7cc043c5aa4459f6102 | [
"Unlicense"
] | null | null | null | from datetime import datetime, timedelta
from typing import Callable, List, Optional, Union
from fastapi import Depends, HTTPException, Request, status
from fastapi.security import OAuth2PasswordBearer
from jose import JWTError, jwt
from passlib.context import CryptContext
from pydantic import BaseModel
from sqlmodel ... | 28.265625 | 79 | 0.700387 | from datetime import datetime, timedelta
from typing import Callable, List, Optional, Union
from fastapi import Depends, HTTPException, Request, status
from fastapi.security import OAuth2PasswordBearer
from jose import JWTError, jwt
from passlib.context import CryptContext
from pydantic import BaseModel
from sqlmodel ... | true | true |
f76b196e0bc26a8783da2f87311854fef847510b | 1,049 | py | Python | a2scomp/zipalign.py | voider1/a2scomp | da27474bee7ea6edaa10bfd56291ac66789866a4 | [
"Apache-2.0"
] | 12 | 2017-03-24T15:53:32.000Z | 2021-01-05T07:32:26.000Z | a2scomp/zipalign.py | voider1/a2scomp | da27474bee7ea6edaa10bfd56291ac66789866a4 | [
"Apache-2.0"
] | null | null | null | a2scomp/zipalign.py | voider1/a2scomp | da27474bee7ea6edaa10bfd56291ac66789866a4 | [
"Apache-2.0"
] | 2 | 2018-03-21T06:37:46.000Z | 2020-01-03T09:54:19.000Z | import subprocess
import sys
import click
from a2scomp.a2scomp import cli
from a2scomp import apksign
@cli.command()
@click.option('--sign', is_flag=True,
help='After aligning it, sign the APK')
@click.pass_context
def zipalign(ctx, sign):
config = ctx.obj
if config.apk:
click.echo('G... | 26.225 | 72 | 0.557674 | import subprocess
import sys
import click
from a2scomp.a2scomp import cli
from a2scomp import apksign
@cli.command()
@click.option('--sign', is_flag=True,
help='After aligning it, sign the APK')
@click.pass_context
def zipalign(ctx, sign):
config = ctx.obj
if config.apk:
click.echo('G... | true | true |
f76b19ccc792f7c84bf0b08d8461b40384d67fad | 1,612 | py | Python | test/collect_data.py | glauberrleite/ventilator-microcontroller | 3b0b489a71e841bf152059585de1d54f4e95e4cc | [
"MIT"
] | null | null | null | test/collect_data.py | glauberrleite/ventilator-microcontroller | 3b0b489a71e841bf152059585de1d54f4e95e4cc | [
"MIT"
] | null | null | null | test/collect_data.py | glauberrleite/ventilator-microcontroller | 3b0b489a71e841bf152059585de1d54f4e95e4cc | [
"MIT"
] | null | null | null | import serial
import numpy as np
import time
import signal
import sys
import pandas as pd
import matplotlib.pyplot as plt
def signal_handler(sig, frame):
ser.close()
df = pd.DataFrame({'time':l_time, 'state':l_state, 'fl_int':l_fl_int, 'pres_int':l_pres_int, 'pres_pac':l_pres_pac, 'pres_exp':l_pres_exp, '... | 22.388889 | 162 | 0.646402 | import serial
import numpy as np
import time
import signal
import sys
import pandas as pd
import matplotlib.pyplot as plt
def signal_handler(sig, frame):
ser.close()
df = pd.DataFrame({'time':l_time, 'state':l_state, 'fl_int':l_fl_int, 'pres_int':l_pres_int, 'pres_pac':l_pres_pac, 'pres_exp':l_pres_exp, '... | true | true |
f76b1a1707c715de089e90559c1017149561d05c | 6,810 | py | Python | pyrapostbin-appsrv/views/user_views.py | todpunk/pyrapostbin | 14de6012a0b74398973ea472d2c181d4086fa986 | [
"MIT"
] | null | null | null | pyrapostbin-appsrv/views/user_views.py | todpunk/pyrapostbin | 14de6012a0b74398973ea472d2c181d4086fa986 | [
"MIT"
] | null | null | null | pyrapostbin-appsrv/views/user_views.py | todpunk/pyrapostbin | 14de6012a0b74398973ea472d2c181d4086fa986 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import re
from datetime import datetime
from uuid import uuid4
from cornice import Service
from email_validator import validate_email, EmailNotValidError
from db import Session, User
from utilities import error_dict, hash_password
# Sphinx doc stuff
from db.converters import dict_fr... | 37.417582 | 117 | 0.690162 | import os
import re
from datetime import datetime
from uuid import uuid4
from cornice import Service
from email_validator import validate_email, EmailNotValidError
from db import Session, User
from utilities import error_dict, hash_password
from db.converters import dict_from_row
users_desc = """
Work with users or... | true | true |
f76b1a6f7396695d1e8caf28ae9b5bca94937444 | 688 | py | Python | common/myUtils.py | AlexandreMPDias/build-setup | f5172085dab9cf07a815fa85c9dc159d026a35ab | [
"MIT"
] | null | null | null | common/myUtils.py | AlexandreMPDias/build-setup | f5172085dab9cf07a815fa85c9dc159d026a35ab | [
"MIT"
] | null | null | null | common/myUtils.py | AlexandreMPDias/build-setup | f5172085dab9cf07a815fa85c9dc159d026a35ab | [
"MIT"
] | null | null | null | import os
import platform as p
import sys
import json
from os.path import join
def read_json(path):
try:
with open(path) as f:
output = json.loads(f.read())
return output
except:
try:
with open(join("..","..", path)) as f:
output = json.loads(f.re... | 22.193548 | 57 | 0.543605 | import os
import platform as p
import sys
import json
from os.path import join
def read_json(path):
try:
with open(path) as f:
output = json.loads(f.read())
return output
except:
try:
with open(join("..","..", path)) as f:
output = json.loads(f.re... | true | true |
f76b1a7c4c2150d1c92d03ee34fcf3bd7c13f775 | 502 | py | Python | migrations/0004_auto_20180605_1438.py | abezpalov/extractor | 8a0e3ca44ddb932b2c12ede05e3e26090f239a27 | [
"MIT"
] | null | null | null | migrations/0004_auto_20180605_1438.py | abezpalov/extractor | 8a0e3ca44ddb932b2c12ede05e3e26090f239a27 | [
"MIT"
] | null | null | null | migrations/0004_auto_20180605_1438.py | abezpalov/extractor | 8a0e3ca44ddb932b2c12ede05e3e26090f239a27 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-05 14:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('extractor', '0003_extracteddata'),
]
operations = [
migrations.RenameField(
model_name='extracteddata',
old_name='filename',... | 20.916667 | 47 | 0.553785 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('extractor', '0003_extracteddata'),
]
operations = [
migrations.RenameField(
model_name='extracteddata',
old_name='filename',
new_name='file',
),
... | true | true |
f76b1b4176a743ae6744e0bcfe6f7312244b06dc | 5,641 | py | Python | scripts/performance/perf_load.py | pysingh09/indy-node | 060944dfcd1530fd0a11b7f119a6c37ab00b3c17 | [
"Apache-2.0"
] | 1 | 2018-07-05T19:34:29.000Z | 2018-07-05T19:34:29.000Z | scripts/performance/perf_load.py | Alonewolf-123/indy-node | 50fda625ae0300802eddc549870cb3fa129d6e16 | [
"Apache-2.0"
] | null | null | null | scripts/performance/perf_load.py | Alonewolf-123/indy-node | 50fda625ae0300802eddc549870cb3fa129d6e16 | [
"Apache-2.0"
] | 1 | 2021-06-06T15:48:30.000Z | 2021-06-06T15:48:30.000Z | """
Created on Feb 27, 2018
@author: nhan.nguyen
This module contains class "TesterSimulateLoad" that performs load testing.
"""
import threading
import time
import utils
import asyncio
import argparse
import random
import requests_builder
import requests_sender
from perf_tester import Tester
class Option:
de... | 32.988304 | 79 | 0.582521 |
import threading
import time
import utils
import asyncio
import argparse
import random
import requests_builder
import requests_sender
from perf_tester import Tester
class Option:
def __init__(self):
parser = argparse.ArgumentParser(
description='Script to perform load testing. Send a specifi... | true | true |
f76b1b4fa5200c1af54676bc147028daa1a95856 | 1,200 | py | Python | tests/test_database.py | himanshu1root/opsdroid | 26699c5e7cc014a0d3ab74baf66fbadce939ab73 | [
"Apache-2.0"
] | 1 | 2019-06-12T04:50:25.000Z | 2019-06-12T04:50:25.000Z | tests/test_database.py | himanshu1root/opsdroid | 26699c5e7cc014a0d3ab74baf66fbadce939ab73 | [
"Apache-2.0"
] | 10 | 2019-06-22T11:18:55.000Z | 2019-09-03T13:26:47.000Z | tests/test_database.py | himanshu1root/opsdroid | 26699c5e7cc014a0d3ab74baf66fbadce939ab73 | [
"Apache-2.0"
] | 1 | 2019-06-11T22:30:49.000Z | 2019-06-11T22:30:49.000Z | import unittest
import asynctest
from opsdroid.database import Database
class TestDatabaseBaseClass(unittest.TestCase):
"""Test the opsdroid database base class."""
def test_init(self):
config = {"example_item": "test"}
database = Database(config)
self.assertEqual("", database.name)
... | 29.268293 | 78 | 0.655833 | import unittest
import asynctest
from opsdroid.database import Database
class TestDatabaseBaseClass(unittest.TestCase):
def test_init(self):
config = {"example_item": "test"}
database = Database(config)
self.assertEqual("", database.name)
self.assertEqual("test", database.config[... | true | true |
f76b1b9e5fc3b3c18ebf08858580a8b250ba7851 | 12,829 | py | Python | deuces/evaluator.py | hushidong/Deuces-python3 | 9f8631213ef4c8b6fc8df86705f89c6e709cea74 | [
"Unlicense"
] | 1 | 2020-11-11T02:31:02.000Z | 2020-11-11T02:31:02.000Z | deuces/evaluator.py | hushidong/Deuces-python3 | 9f8631213ef4c8b6fc8df86705f89c6e709cea74 | [
"Unlicense"
] | null | null | null | deuces/evaluator.py | hushidong/Deuces-python3 | 9f8631213ef4c8b6fc8df86705f89c6e709cea74 | [
"Unlicense"
] | null | null | null | import itertools
from .card import Card
from .deck import Deck
from .lookup import LookupTable
class Evaluator(object):
"""
Evaluates hand strengths using a variant of Cactus Kev's algorithm:
http://www.suffecool.net/poker/evaluator.html
I make considerable optimizations in terms of speed and memory u... | 37.621701 | 108 | 0.55281 | import itertools
from .card import Card
from .deck import Deck
from .lookup import LookupTable
class Evaluator(object):
def __init__(self):
self.table = LookupTable()
self.hand_size_map = {
2 : self._two,
5 : self._five,
6 : self._six,
7 : ... | true | true |
f76b1c266384d2a81190d6ee8a4c33a57fa53d05 | 535 | py | Python | 06/01/Calendar/monthdayscalendar.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | 06/01/Calendar/monthdayscalendar.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | 32 | 2017-09-01T00:52:17.000Z | 2017-10-01T00:30:02.000Z | 06/01/Calendar/monthdayscalendar.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | import calendar
#monthdayscalendarの戻り値
#1週間毎の日をlistで返す。前後月の場合、日は0となる。また、週は前月、次月を含む(必ず7日分)。
"""
[0, 0, 0, 0, 1, 2, 3]
[4, 5, 6, 7, 8, 9, 10]
[11, 12, 13, 14, 15, 16, 17]
[18, 19, 20, 21, 22, 23, 24]
[25, 26, 27, 28, 29, 30, 0]
"""
def monthdayscalendar(calendar): return calendar.monthdayscalendar(2017, 9)
for calendar ... | 29.722222 | 87 | 0.672897 | import calendar
def monthdayscalendar(calendar): return calendar.monthdayscalendar(2017, 9)
for calendar in [calendar.Calendar(firstweekday=0), calendar.Calendar(firstweekday=6)]:
print('-----',calendar,'-----')
for weekday in monthdayscalendar(calendar): print(weekday)
| true | true |
f76b1c7cbb9669e4f62aec1c2e307a46f4180ffb | 1,001 | py | Python | pyfi/entity/exchange/model.py | rlinguri/pyfi | 08cccda7eab1119a2a82d265a015c95ba9bf4431 | [
"MIT"
] | null | null | null | pyfi/entity/exchange/model.py | rlinguri/pyfi | 08cccda7eab1119a2a82d265a015c95ba9bf4431 | [
"MIT"
] | null | null | null | pyfi/entity/exchange/model.py | rlinguri/pyfi | 08cccda7eab1119a2a82d265a015c95ba9bf4431 | [
"MIT"
] | 1 | 2019-01-12T17:02:01.000Z | 2019-01-12T17:02:01.000Z | #!/usr/bin/env python
import os
import pyfwk
from pyfi.entity.entity.db import EntityDB
# -----------------------------EXCHANGE-MODEL-----------------------------#
class ExchangeModel(pyfwk.Model):
model = None
dbase = None
table = None
columns = None
@staticmethod
def instance():
i... | 25.025 | 75 | 0.546454 |
import os
import pyfwk
from pyfi.entity.entity.db import EntityDB
class ExchangeModel(pyfwk.Model):
model = None
dbase = None
table = None
columns = None
@staticmethod
def instance():
if not ExchangeModel.model:
ExchangeModel.model = ExchangeModel()
return Exchan... | true | true |
f76b1d3382709acb2dcc0e7a7007032464b9ffca | 2,027 | py | Python | rng_fdw/__init__.py | yieldsfalsehood/rng_fdw | 31a181a6a912f0b1072c7ed9f09c5bd0afa052b8 | [
"MIT"
] | 1 | 2016-06-26T10:43:20.000Z | 2016-06-26T10:43:20.000Z | rng_fdw/__init__.py | yieldsfalsehood/rng_fdw | 31a181a6a912f0b1072c7ed9f09c5bd0afa052b8 | [
"MIT"
] | null | null | null | rng_fdw/__init__.py | yieldsfalsehood/rng_fdw | 31a181a6a912f0b1072c7ed9f09c5bd0afa052b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from multicorn import ForeignDataWrapper
import numpy as np
import scipy.stats
class RNGWrapper(ForeignDataWrapper):
def __init__(self, options, columns):
super(RNGWrapper, self).__init__(options, columns)
self.columns = columns
# default to the normal distributio... | 33.783333 | 92 | 0.583621 |
from multicorn import ForeignDataWrapper
import numpy as np
import scipy.stats
class RNGWrapper(ForeignDataWrapper):
def __init__(self, options, columns):
super(RNGWrapper, self).__init__(options, columns)
self.columns = columns
distribution = options.get("distribution", "norm"... | true | true |
f76b1da70472a0cdb14f28772204663caa353583 | 1,058 | py | Python | auto_events/form/microsoft/components/Radio.py | fedecech/form_automator | b20364803b000333b24ce55ef8c01a18d7b47f23 | [
"MIT"
] | null | null | null | auto_events/form/microsoft/components/Radio.py | fedecech/form_automator | b20364803b000333b24ce55ef8c01a18d7b47f23 | [
"MIT"
] | null | null | null | auto_events/form/microsoft/components/Radio.py | fedecech/form_automator | b20364803b000333b24ce55ef8c01a18d7b47f23 | [
"MIT"
] | null | null | null | from typing import Any
from selenium.webdriver.remote.webelement import WebElement
from ..MicrosoftFormComponent import MicrosoftFormComponent
class Radio(MicrosoftFormComponent):
"""Create a Microsoft form Radio (select with no dropdown) component
Paramaters
----------
web_element: `'WebElement'`, ... | 32.060606 | 105 | 0.637996 | from typing import Any
from selenium.webdriver.remote.webelement import WebElement
from ..MicrosoftFormComponent import MicrosoftFormComponent
class Radio(MicrosoftFormComponent):
def __init__(self, web_element: 'WebElement' = None) -> None:
super().__init__(web_element=web_element)
def fill_in(sel... | true | true |
f76b1e3b143dace67d81deb42e192e4145fd014e | 3,590 | py | Python | Dragon_signature desciptors/Step 2 - Regression Models/RandomForestRegression_SHAP_Analysis.py | Grazziela/ChiralLigands | 8a786212c464bdef8141643d29122c18fd73bc5f | [
"Apache-2.0"
] | null | null | null | Dragon_signature desciptors/Step 2 - Regression Models/RandomForestRegression_SHAP_Analysis.py | Grazziela/ChiralLigands | 8a786212c464bdef8141643d29122c18fd73bc5f | [
"Apache-2.0"
] | null | null | null | Dragon_signature desciptors/Step 2 - Regression Models/RandomForestRegression_SHAP_Analysis.py | Grazziela/ChiralLigands | 8a786212c464bdef8141643d29122c18fd73bc5f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 4 13:52:25 2019
SHAP importance calculation for Random Forests with standard parameters
using training/test split
Obs: Run the code in the same folder as your data files
@author: Grazziela Figueredo
"""
import pandas as pd #for manipulating data
import nump... | 36.632653 | 138 | 0.705292 | import pandas as pd import numpy as np
import sklearn import sklearn.ensemble from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score
from sklearn.metrics import mean_squared_error
import shap import matplotlib.pyplot as plt
from matplotlib import cm
def plot_regression(y, y... | true | true |
f76b1e6e972fab48ed42526cf07851b9196cda09 | 2,402 | py | Python | tests/test_app.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 11 | 2019-10-30T08:14:49.000Z | 2021-09-28T07:46:58.000Z | tests/test_app.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 15 | 2019-09-09T07:31:41.000Z | 2022-03-11T23:54:18.000Z | tests/test_app.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 2 | 2019-10-31T21:10:27.000Z | 2022-02-14T19:39:57.000Z | import sys, os
import cv2
import pytest
import base64
import matchvec
import io
def assert_clio(resp_data) :
assert resp_data[0][0]["brand_model_classif"]["prob"][0] > 0.8, 'Classif confidence too low %s'%resp_data
assert resp_data[0][0]["brand_model_classif"]["pred"][0] == "RENAULT CLIO", 'Not a clio'
a... | 33.830986 | 109 | 0.636137 | import sys, os
import cv2
import pytest
import base64
import matchvec
import io
def assert_clio(resp_data) :
assert resp_data[0][0]["brand_model_classif"]["prob"][0] > 0.8, 'Classif confidence too low %s'%resp_data
assert resp_data[0][0]["brand_model_classif"]["pred"][0] == "RENAULT CLIO", 'Not a clio'
a... | true | true |
f76b1ec933df08d9c7e91dcb3f9a4886af754e8d | 2,272 | py | Python | numba/typing/cmathdecl.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | 1 | 2015-01-29T06:52:36.000Z | 2015-01-29T06:52:36.000Z | numba/typing/cmathdecl.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | numba/typing/cmathdecl.py | meawoppl/numba | bb8df0aee99133c6d52465ae9f9df2a7996339f3 | [
"BSD-2-Clause"
] | null | null | null | import cmath
from numba import types, utils
from numba.typing.templates import (AbstractTemplate, ConcreteTemplate,
signature, Registry, bound_function)
registry = Registry()
# TODO: support non-complex arguments (floats and ints)
@registry.resolves_global(cmath.acos)
@registry.r... | 31.555556 | 73 | 0.743838 | import cmath
from numba import types, utils
from numba.typing.templates import (AbstractTemplate, ConcreteTemplate,
signature, Registry, bound_function)
registry = Registry()
@registry.resolves_global(cmath.acos)
@registry.resolves_global(cmath.acosh)
@registry.resolves_global(cm... | true | true |
f76b1edda21ac5fe3fdbb371a4ce2fcb0934b6c2 | 1,199 | py | Python | tests/stakes_test.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | tests/stakes_test.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | tests/stakes_test.py | glieb/dilemma | f61d564314f3f5494da19fb4212d9dd04d77b284 | [
"MIT"
] | null | null | null | import sys
sys.path.append("..")
from dilemma.stakes import generate_stakes
from dilemma.config import lowest_stakes, highest_stakes
def main(iterations):
try:
iterations = int(iterations)
except ValueError:
print("First argument must be an int")
exit()
for _ in range(iterations):
... | 30.74359 | 63 | 0.59633 | import sys
sys.path.append("..")
from dilemma.stakes import generate_stakes
from dilemma.config import lowest_stakes, highest_stakes
def main(iterations):
try:
iterations = int(iterations)
except ValueError:
print("First argument must be an int")
exit()
for _ in range(iterations):
... | true | true |
f76b1eea647b31ef9a7e1fb67241f90222c52073 | 6,069 | py | Python | mffpy/header_block/header_block.py | BEL-Public/mffpy | 8515824d89a77cf10f7c36bb405f61d338b6f5fe | [
"Apache-2.0"
] | 7 | 2019-09-24T07:05:56.000Z | 2021-12-12T12:10:08.000Z | mffpy/header_block/header_block.py | BEL-Public/mffpy | 8515824d89a77cf10f7c36bb405f61d338b6f5fe | [
"Apache-2.0"
] | 44 | 2019-09-24T21:30:55.000Z | 2022-02-10T17:47:14.000Z | mffpy/header_block/header_block.py | BEL-Public/mffpy | 8515824d89a77cf10f7c36bb405f61d338b6f5fe | [
"Apache-2.0"
] | 4 | 2019-09-24T07:06:04.000Z | 2021-11-08T20:25:18.000Z | """Management of header blocks in .mff binary files
.mff binary files have a blocked structure. Consecutive blocks can be
separated by a header, which brings us to the topic of this module.
The header consists of either a single flag (`flag=0`) or a block describing
the following bytes of signal data (`flag=1`). Re... | 38.411392 | 79 | 0.58115 |
from typing import Optional, Tuple
from collections import namedtuple
import numpy as np
from .helpers import FileLike, read, skip, write
from . import optional_header_block as opt
HEADER_BLOCK_PRESENT = 1
_HeaderBlock = namedtuple('_HeaderBlock', [
'header_size',
'block_size',
'num_channels',
'num... | true | true |
f76b215aef89c98a1bac578be69296216804ff19 | 6,507 | py | Python | python/onshape_client/oas/models/bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | python/onshape_client/oas/models/bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | python/onshape_client/oas/models/bt_webhook_info.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | 35.172973 | 84 | 0.57369 |
from __future__ import absolute_import
import re import sys
import six import nulltype
from onshape_client.oas.model_utils import ( ModelComposed,
ModelNormal,
ModelSimple,
date,
datetime,
file_type,
int,
none_type,
str,
validate_get_composed_info,
)
try:
from onsh... | true | true |
f76b21cbf6c56c7683cb3aa7266dd7ab1b62395d | 423 | py | Python | setup.py | JarbasAl/wikipedia_for_humans | b5a4c308e9c83d650d3593d39eba13d21a433a97 | [
"MIT"
] | 9 | 2020-05-31T14:22:31.000Z | 2021-12-19T08:26:36.000Z | setup.py | JarbasAl/wikipedia_for_humans | b5a4c308e9c83d650d3593d39eba13d21a433a97 | [
"MIT"
] | 1 | 2021-02-09T20:13:36.000Z | 2021-02-25T22:47:17.000Z | setup.py | JarbasAl/wikipedia_for_humans | b5a4c308e9c83d650d3593d39eba13d21a433a97 | [
"MIT"
] | 4 | 2020-08-11T17:12:16.000Z | 2021-10-08T04:03:19.000Z | from setuptools import setup
setup(
name='wikipedia_for_humans',
version='0.3.0',
packages=['wikipedia_for_humans'],
url='https://github.com/OpenJarbas/wikipedia_for_humans',
license='MIT',
author='jarbasAI',
install_requires=["requests", "wikipedia-api",
"inflection",... | 28.2 | 61 | 0.669031 | from setuptools import setup
setup(
name='wikipedia_for_humans',
version='0.3.0',
packages=['wikipedia_for_humans'],
url='https://github.com/OpenJarbas/wikipedia_for_humans',
license='MIT',
author='jarbasAI',
install_requires=["requests", "wikipedia-api",
"inflection",... | true | true |
f76b23be0904d8cb9ab6247795a773dfc5b6e5b0 | 1,018 | py | Python | rotation.py | KR-16/Open-CV | 113efc84954aee0a16048e6b1f43e8247c45bf38 | [
"Apache-2.0"
] | null | null | null | rotation.py | KR-16/Open-CV | 113efc84954aee0a16048e6b1f43e8247c45bf38 | [
"Apache-2.0"
] | null | null | null | rotation.py | KR-16/Open-CV | 113efc84954aee0a16048e6b1f43e8247c45bf38 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2 as cv
image = cv.imread("boy.jpg",cv.IMREAD_COLOR)
cv.imshow("Original Image",image)
# Dimensions of the image and calculate the centre if the image
# width = across x-axis
#height = across y-axis
height,width,channels = image.shape
center_x, center_y = (width/2,height/2)
... | 35.103448 | 92 | 0.718075 | import numpy as np
import cv2 as cv
image = cv.imread("boy.jpg",cv.IMREAD_COLOR)
cv.imshow("Original Image",image)
height,width,channels = image.shape
center_x, center_y = (width/2,height/2)
Matrix_1 = cv.getRotationMatrix2D(center = (center_x,center_y),angle = 45,scale = 1.0)
#Rotating the image
rota... | true | true |
f76b26290492ca4dd7ac0166c522ea77c52ca540 | 942 | py | Python | managerapi/authentication/backends.py | anushiv25/Assignment | 8eefb9a038019c1a126b0b3040107e87e0964998 | [
"MIT"
] | null | null | null | managerapi/authentication/backends.py | anushiv25/Assignment | 8eefb9a038019c1a126b0b3040107e87e0964998 | [
"MIT"
] | null | null | null | managerapi/authentication/backends.py | anushiv25/Assignment | 8eefb9a038019c1a126b0b3040107e87e0964998 | [
"MIT"
] | null | null | null | #Implementing JWT Authentication for the API's
import jwt
from rest_framework import authentication, exceptions
from django.conf import settings
from .models import User
class JWTAuthentication(authentication.BaseAuthentication):
def authenticate(self, request):
auth_data = authentication.get_authorizati... | 33.642857 | 81 | 0.693206 | import jwt
from rest_framework import authentication, exceptions
from django.conf import settings
from .models import User
class JWTAuthentication(authentication.BaseAuthentication):
def authenticate(self, request):
auth_data = authentication.get_authorization_header(request)
if not auth_data:
... | true | true |
f76b266265adf56f02d3601ba4a3f1ce9ef538a4 | 4,646 | py | Python | mgf_reader.py | masakimu/mgf_reader | edc651b88a2404057cd7ca83e52d526551148a48 | [
"BSD-2-Clause"
] | null | null | null | mgf_reader.py | masakimu/mgf_reader | edc651b88a2404057cd7ca83e52d526551148a48 | [
"BSD-2-Clause"
] | null | null | null | mgf_reader.py | masakimu/mgf_reader | edc651b88a2404057cd7ca83e52d526551148a48 | [
"BSD-2-Clause"
] | null | null | null | '''
Copyright (c) 2018, Masaki Murase
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the f... | 36.296875 | 100 | 0.569522 |
import sys
import re
import copy
ptn_comment=re.compile(r'^#|^[\s\t]?$')
class mz_intensity_charge():
def __init__(self, mz=0.0, intensity=0.0, charge=-1):
self.mz=mz
self.intensity=intensity
self.charge=charge
def __str__(self):
if self.charge==-1:
... | true | true |
f76b2663d1202d25acb13cac3fa37a195ddf2d39 | 1,592 | py | Python | tinypng.py | smallstrong0/Lazy | 0d724857b15020f16b8429bfbd327c68af599e0a | [
"Apache-2.0"
] | 2 | 2017-06-29T01:48:44.000Z | 2020-02-21T09:05:06.000Z | tinypng.py | smallstrong0/Lazy | 0d724857b15020f16b8429bfbd327c68af599e0a | [
"Apache-2.0"
] | null | null | null | tinypng.py | smallstrong0/Lazy | 0d724857b15020f16b8429bfbd327c68af599e0a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import sys
import os.path
import tinify
tinify.key = "gfx-gzBLyuVpvleuuf_ragZBcqKmrkWi" # API KEY
# 压缩的核心
def compress_core(inputFile, outputFile):
source = tinify.from_file(inputFile)
source.to_file(outputFile)
# 压缩一个文件夹下的图片
def compress_path(path,suf):
i... | 25.269841 | 77 | 0.652638 |
import os
import sys
import os.path
import tinify
tinify.key = "gfx-gzBLyuVpvleuuf_ragZBcqKmrkWi"
def compress_core(inputFile, outputFile):
source = tinify.from_file(inputFile)
source.to_file(outputFile)
def compress_path(path,suf):
if not os.path.isdir(path):
print "这不是一个文件夹,请输入文件夹的正确路径!"
return
else:
f... | false | true |
f76b2699c685f69d34e0cd592f2c61b63272bbb0 | 33,482 | py | Python | tests/unit/test_utils.py | joguSD/s3transfer | f1c9ea74cec9fa1412fe22a68d361e65749cc1cb | [
"Apache-2.0"
] | null | null | null | tests/unit/test_utils.py | joguSD/s3transfer | f1c9ea74cec9fa1412fe22a68d361e65749cc1cb | [
"Apache-2.0"
] | null | null | null | tests/unit/test_utils.py | joguSD/s3transfer | f1c9ea74cec9fa1412fe22a68d361e65749cc1cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 38.177879 | 79 | 0.660026 | import os.path
import shutil
import tempfile
import threading
import random
import time
import io
import mock
from tests import unittest
from tests import RecordingSubscriber
from tests import NonSeekableWriter
from s3transfer.compat import six
from s3transfer.futures import TransferFuture
from s3transfer.futures imp... | true | true |
f76b2778d48b35fe2ddb5b47c81e55717f445819 | 17,403 | py | Python | smartsim/experiment.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | smartsim/experiment.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | smartsim/experiment.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | # BSD 2-Clause License
#
# Copyright (c) 2021, Hewlett Packard Enterprise
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright noti... | 37.506466 | 95 | 0.580417 |
import os.path as osp
import time
from os import getcwd
from pprint import pformat
import pandas as pd
from tqdm import trange
from .control import Controller
from .entity import Ensemble, EntityList, Model, SmartSimEntity
from .error import SmartSimError
from .generation import Generator
from .utils import get_logg... | true | true |
f76b27de35356690d223f99df6daa1d691fc1331 | 152 | py | Python | app.py | luccasdm/devopslab | 31c50f384d094d0d1596f7ffb68751516a4df194 | [
"MIT"
] | null | null | null | app.py | luccasdm/devopslab | 31c50f384d094d0d1596f7ffb68751516a4df194 | [
"MIT"
] | null | null | null | app.py | luccasdm/devopslab | 31c50f384d094d0d1596f7ffb68751516a4df194 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route("/")
def pagina_inicial():
return "Olá Luccas"
if __name__ == '__main__':
app.run()
| 13.818182 | 26 | 0.657895 | from flask import Flask
app = Flask(__name__)
@app.route("/")
def pagina_inicial():
return "Olá Luccas"
if __name__ == '__main__':
app.run()
| true | true |
f76b29ccd2d6b14806b6ea0c30abeb3da8c45cd1 | 510,429 | py | Python | seleniumbase/fixtures/base_case.py | ajitava-git/SeleniumBase | 26633fbea33674797b8cde1a437745cfece508f8 | [
"MIT"
] | null | null | null | seleniumbase/fixtures/base_case.py | ajitava-git/SeleniumBase | 26633fbea33674797b8cde1a437745cfece508f8 | [
"MIT"
] | null | null | null | seleniumbase/fixtures/base_case.py | ajitava-git/SeleniumBase | 26633fbea33674797b8cde1a437745cfece508f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
r""" ------------> ------------> ------------> ------------>
______ __ _ ____
/ ____/__ / /__ ____ (_)_ ______ ___ / _ \____ ________
\__ \/ _ \/ / _ \/ __ \/ / / / / __ `__ \/ /_) / __ \/ ___/ _ \
___/ / __/ / __/ / / / / /_/ / / / / / / /_) / ... | 42.617433 | 79 | 0.562104 |
import codecs
import json
import logging
import os
import re
import shutil
import sys
import time
import unittest
import urllib3
from selenium.common.exceptions import (
ElementClickInterceptedException as ECI_Exception,
ElementNotInteractableException as ENI_Exception,
MoveTargetOutOfBoundsException,
... | true | true |
f76b2a7bc261fcbc1f4de3311ba48870e6a450e8 | 184 | py | Python | src/vandermonde/__init__.py | nschloe/vandermonde | 548052199ed1da33234d148aa92fac0c2d0cee35 | [
"MIT"
] | 1 | 2018-12-13T21:30:17.000Z | 2018-12-13T21:30:17.000Z | src/vandermonde/__init__.py | nschloe/vandermonde | 548052199ed1da33234d148aa92fac0c2d0cee35 | [
"MIT"
] | null | null | null | src/vandermonde/__init__.py | nschloe/vandermonde | 548052199ed1da33234d148aa92fac0c2d0cee35 | [
"MIT"
] | null | null | null | from .__about__ import __version__
from .main import det, matrix, solve, solve_transpose
__all__ = [
"__version__",
"matrix",
"det",
"solve",
"solve_transpose",
]
| 16.727273 | 53 | 0.652174 | from .__about__ import __version__
from .main import det, matrix, solve, solve_transpose
__all__ = [
"__version__",
"matrix",
"det",
"solve",
"solve_transpose",
]
| true | true |
f76b2ab956b33cf98731dde822359313749293b5 | 4,058 | py | Python | custom_app/hooks.py | Talleyrand333/Custom-App | 6079e95dbeabf320be3886ddd7429904d98cb638 | [
"MIT"
] | null | null | null | custom_app/hooks.py | Talleyrand333/Custom-App | 6079e95dbeabf320be3886ddd7429904d98cb638 | [
"MIT"
] | null | null | null | custom_app/hooks.py | Talleyrand333/Custom-App | 6079e95dbeabf320be3886ddd7429904d98cb638 | [
"MIT"
] | null | null | null | from . import __version__ as app_version
app_name = "custom_app"
app_title = "Custom App"
app_publisher = "ebukaakeru@gmail.com"
app_description = "Custom App"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "ebukaakeru@gmail.com"
app_license = "MIT"
# Includes in <head>
# -----------------... | 22.670391 | 78 | 0.664367 | from . import __version__ as app_version
app_name = "custom_app"
app_title = "Custom App"
app_publisher = "ebukaakeru@gmail.com"
app_description = "Custom App"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "ebukaakeru@gmail.com"
app_license = "MIT"
doctype_js = {"Sales Invoice" : "p... | true | true |
f76b2ae667ed83c91967e9d6debd43eef32ff31a | 3,253 | py | Python | tests/estadisticas.py | WerzSoft/PElyzer | 18ab87bb4aafaf7a9f02749545a4ba110c1036fe | [
"MIT"
] | 10 | 2019-05-25T14:21:02.000Z | 2021-07-11T22:10:48.000Z | tests/estadisticas.py | WerzSoft/PElyzer | 18ab87bb4aafaf7a9f02749545a4ba110c1036fe | [
"MIT"
] | null | null | null | tests/estadisticas.py | WerzSoft/PElyzer | 18ab87bb4aafaf7a9f02749545a4ba110c1036fe | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
datos = pd.read_csv("pelyzer/recursos/dataset.csv")
#visualizacion valore... | 29.306306 | 62 | 0.732247 | import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
datos = pd.read_csv("pelyzer/recursos/dataset.csv")
sns.heatmap(datos.isn... | true | true |
f76b2c504ed1145aedf73b70ae60199af8365c65 | 13,934 | py | Python | app.py | pawangeek/CovidHack | 3a57106eeb443550bb801a8120243b992bc960fb | [
"BSD-3-Clause"
] | null | null | null | app.py | pawangeek/CovidHack | 3a57106eeb443550bb801a8120243b992bc960fb | [
"BSD-3-Clause"
] | null | null | null | app.py | pawangeek/CovidHack | 3a57106eeb443550bb801a8120243b992bc960fb | [
"BSD-3-Clause"
] | null | null | null | import requests, json, populartimes
import numpy as np
import pandas as pd
from itsdangerous import URLSafeTimedSerializer, SignatureExpired
from form import DetailForm, UserForm, UserLogin, NGOForm
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from datetime import datetim... | 36.862434 | 146 | 0.63119 | import requests, json, populartimes
import numpy as np
import pandas as pd
from itsdangerous import URLSafeTimedSerializer, SignatureExpired
from form import DetailForm, UserForm, UserLogin, NGOForm
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from datetime import datetim... | true | true |
f76b2d64133d50962397f8c73c0a4b04245431fb | 1,296 | py | Python | cbagent/settings.py | daverigby/cbagent | 50474365c3b1ed3d7155909c1d42ef2f88141ffb | [
"Apache-2.0"
] | 1 | 2021-03-03T23:04:26.000Z | 2021-03-03T23:04:26.000Z | cbagent/settings.py | daverigby/cbagent | 50474365c3b1ed3d7155909c1d42ef2f88141ffb | [
"Apache-2.0"
] | null | null | null | cbagent/settings.py | daverigby/cbagent | 50474365c3b1ed3d7155909c1d42ef2f88141ffb | [
"Apache-2.0"
] | 6 | 2015-06-02T10:08:17.000Z | 2016-07-05T21:15:57.000Z | import json
import os
from logger import logger
class Settings(object):
DEFAULT = {
"cbmonitor_host_port": "127.0.0.1:8000",
"seriesly_host": "127.0.0.1",
"interval": 10,
"cluster": "default",
"master_node": "127.0.0.1",
"dest_master_node": "127.0.0.1",
... | 28.173913 | 70 | 0.554784 | import json
import os
from logger import logger
class Settings(object):
DEFAULT = {
"cbmonitor_host_port": "127.0.0.1:8000",
"seriesly_host": "127.0.0.1",
"interval": 10,
"cluster": "default",
"master_node": "127.0.0.1",
"dest_master_node": "127.0.0.1",
... | true | true |
f76b2d91af3a820ad1b4b1ffefdc17eaff4437ce | 24,631 | py | Python | vmap/vmap.py | jmichellehu/vmap | 0f631a0e2d625215ea419cd7ea537f6d5a2ccd57 | [
"MIT"
] | 12 | 2017-09-05T03:23:47.000Z | 2022-03-25T20:01:22.000Z | vmap/vmap.py | jmichellehu/vmap | 0f631a0e2d625215ea419cd7ea537f6d5a2ccd57 | [
"MIT"
] | 3 | 2021-05-19T08:38:58.000Z | 2022-03-16T23:25:45.000Z | vmap/vmap.py | jmichellehu/vmap | 0f631a0e2d625215ea419cd7ea537f6d5a2ccd57 | [
"MIT"
] | 8 | 2017-09-13T00:00:51.000Z | 2022-03-21T13:02:05.000Z | #! /usr/bin/env python
#David Shean
#dshean@gmail.com
#This script uses ASP correlator to produce disparity maps from two inputs
#Input data should be orthorectified/mapped in the same projected coordinate system
#Run disp2v.py to convert to surface velocities
import sys
import os
import argparse
import subprocess
f... | 48.201566 | 293 | 0.644594 |
import sys
import os
import argparse
import subprocess
from datetime import datetime, timedelta
from distutils.spawn import find_executable
from osgeo import gdal
import numpy as np
from pygeotools.lib import warplib, geolib, iolib
from pygeotools.lib.malib import calcperc
from pygeotools.lib.timelib import get_t... | true | true |
f76b2dbff2fc09862c61fea8d3431ef37e7d47ca | 5,931 | py | Python | discovered/discovered.py | peterfraedrich/discovered | fdbcf067dcc3360c5d4791bc8b64279c24bfd3b6 | [
"MIT"
] | null | null | null | discovered/discovered.py | peterfraedrich/discovered | fdbcf067dcc3360c5d4791bc8b64279c24bfd3b6 | [
"MIT"
] | null | null | null | discovered/discovered.py | peterfraedrich/discovered | fdbcf067dcc3360c5d4791bc8b64279c24bfd3b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import redis
import time
import json
import psutil
import socket
import platform
import os
import datetime
import sys
class ServiceDiscovery:
'''
uses Redis for easy service discovery and lookup
by service name
'''
def __init__(self, redis_host='localhost', redis_port=6379,... | 33.508475 | 169 | 0.544765 |
import redis
import time
import json
import psutil
import socket
import platform
import os
import datetime
import sys
class ServiceDiscovery:
def __init__(self, redis_host='localhost', redis_port=6379, redis_db=0, redis_auth=None, ttl=-1, service_group='default', auto=True):
self.ttl = ttl
self.a... | true | true |
f76b2f529a0d38aca06819c248dbc7d8fd7033a2 | 6,053 | py | Python | trac/web/tests/href.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | null | null | null | trac/web/tests/href.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | 1 | 2019-03-20T19:13:53.000Z | 2019-08-14T20:15:09.000Z | trac/web/tests/href.py | haskell-infra/trac | 5e086948718893ede9965ea4ce3625da32676730 | [
"BSD-3-Clause"
] | 2 | 2019-03-20T01:23:30.000Z | 2019-12-06T16:13:07.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2013 Edgewall Software
# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | 45.171642 | 87 | 0.578391 |
import doctest
import unittest
import trac.tests.compat
import trac.web.href
class HrefTestCase(unittest.TestCase):
def test_non_empty_base(self):
href = trac.web.href.Href('/base')
self.assertEqual('/base', href())
self.assertEqual('/base', href('/'))
self.assertEqual('/base/su... | true | true |
f76b319136dc237e75495d2d86bcc22b2ed02adb | 9,710 | py | Python | colorizer/ui.py | danbradham/colorizer | 0071f7fdfa3d88e024103e585c8c194877176c8f | [
"MIT"
] | 2 | 2020-03-26T14:37:42.000Z | 2020-06-20T23:04:52.000Z | colorizer/ui.py | danbradham/colorizer | 0071f7fdfa3d88e024103e585c8c194877176c8f | [
"MIT"
] | null | null | null | colorizer/ui.py | danbradham/colorizer | 0071f7fdfa3d88e024103e585c8c194877176c8f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Standard library imports
from __future__ import print_function, absolute_import
from string import Template
# Third party imports
from Qt import QtCore, QtGui, QtWidgets
# Local imports
from . import api, util
class Swatch(QtWidgets.QWidget):
clicked = QtCore.Signal(object)
style... | 29.603659 | 74 | 0.594233 |
from __future__ import print_function, absolute_import
from string import Template
from Qt import QtCore, QtGui, QtWidgets
from . import api, util
class Swatch(QtWidgets.QWidget):
clicked = QtCore.Signal(object)
style = Template('''
QWidget{
background-color: rgb($cr, $cg, $cb);
... | true | true |
f76b325de5a8b263e16a80024d6dfb8e99248e7f | 86 | py | Python | py_tdlib/constructors/message_venue.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/message_venue.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/message_venue.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Type
class messageVenue(Type):
venue = None # type: "venue"
| 14.333333 | 30 | 0.697674 | from ..factory import Type
class messageVenue(Type):
venue = None | true | true |
f76b32627e136f523099a349463cd5388a1ef2d8 | 4,856 | py | Python | ceilometer/storage/impl_log.py | Missxiaoguo/stx-ceilometer | a226b47216e76ec209818b900253d3c1f1ffc3aa | [
"Apache-2.0"
] | null | null | null | ceilometer/storage/impl_log.py | Missxiaoguo/stx-ceilometer | a226b47216e76ec209818b900253d3c1f1ffc3aa | [
"Apache-2.0"
] | 1 | 2018-08-16T15:18:09.000Z | 2018-08-16T20:51:45.000Z | ceilometer/storage/impl_log.py | Missxiaoguo/stx-ceilometer | a226b47216e76ec209818b900253d3c1f1ffc3aa | [
"Apache-2.0"
] | 3 | 2018-08-15T14:35:23.000Z | 2019-01-11T15:57:02.000Z | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 37.068702 | 78 | 0.632825 |
from oslo_log import log
from ceilometer.storage import base
LOG = log.getLogger(__name__)
class Connection(base.Connection):
def upgrade(self):
pass
def clear(self):
pass
def record_metering_data(self, data):
LOG.info('metering data %(counter_name)s for %(resource_id)s: '
... | true | true |
f76b32cb6fa414565e9297f3a0b2fb1b8b2e9c47 | 959 | py | Python | snorkels/__init__.py | y-du/snorkels | 69eb1d1f502c57b65acfd5d651ab6c1c060f461c | [
"Apache-2.0"
] | null | null | null | snorkels/__init__.py | y-du/snorkels | 69eb1d1f502c57b65acfd5d651ab6c1c060f461c | [
"Apache-2.0"
] | null | null | null | snorkels/__init__.py | y-du/snorkels | 69eb1d1f502c57b65acfd5d651ab6c1c060f461c | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019 Yann Dumont
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 wr... | 30.935484 | 88 | 0.740355 |
__version__ = '1.0.1'
__title__ = 'SNORKELS'
__description__ = 'A lightweight in memory key-value store with on the fly compression.'
__url__ = 'https://github.com/y-du/snorkels'
__author__ = 'Yann Dumont'
__license__ = 'Apache License 2.0'
__copyright__ = 'Copyright (c) 2019 Yann Dumont'
from .kvs import *
import s... | true | true |
f76b351b333c58a230752e9324a674b479789527 | 1,161 | py | Python | the-predictive-lambda/python/the_predictive_lambda/the_predictive_lambda_stack.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 1,627 | 2020-01-12T10:35:06.000Z | 2022-03-31T13:12:51.000Z | the-predictive-lambda/python/the_predictive_lambda/the_predictive_lambda_stack.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 58 | 2020-02-09T06:57:35.000Z | 2022-02-26T23:25:10.000Z | the-predictive-lambda/python/the_predictive_lambda/the_predictive_lambda_stack.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 240 | 2020-01-19T09:09:44.000Z | 2022-03-30T19:12:17.000Z | from aws_cdk import (
aws_lambda as _lambda,
aws_apigatewayv2 as api_gw,
aws_apigatewayv2_integrations as integrations,
core
)
import os
class ThePredictiveLambdaStack(core.Stack):
def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, cons... | 44.653846 | 116 | 0.614126 | from aws_cdk import (
aws_lambda as _lambda,
aws_apigatewayv2 as api_gw,
aws_apigatewayv2_integrations as integrations,
core
)
import os
class ThePredictiveLambdaStack(core.Stack):
def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, cons... | true | true |
f76b358cc5ced8a72547620782bfcf029843976b | 145 | py | Python | Constant.py | gavinliu/OpenGPD-QT | ae16fd02908e72a958ec80409626ad80021a87d2 | [
"Unlicense",
"MIT"
] | null | null | null | Constant.py | gavinliu/OpenGPD-QT | ae16fd02908e72a958ec80409626ad80021a87d2 | [
"Unlicense",
"MIT"
] | null | null | null | Constant.py | gavinliu/OpenGPD-QT | ae16fd02908e72a958ec80409626ad80021a87d2 | [
"Unlicense",
"MIT"
] | 1 | 2019-09-22T10:25:10.000Z | 2019-09-22T10:25:10.000Z |
ACTION_TOUCH_DOWN = 1
ACTION_TOUCH_UP = 2
ACTION_TOUCH_SWIPE = 3
ACTION_GET_RULES = "ACTION_GET_RULES"
ACTION_HEART_BEAT = "ACTION_HEART_BEAT"
| 18.125 | 39 | 0.82069 |
ACTION_TOUCH_DOWN = 1
ACTION_TOUCH_UP = 2
ACTION_TOUCH_SWIPE = 3
ACTION_GET_RULES = "ACTION_GET_RULES"
ACTION_HEART_BEAT = "ACTION_HEART_BEAT"
| true | true |
f76b39f9736c26dc9af3b70fdea42bafc3680147 | 987 | py | Python | kubernetes/test/test_v1_resource_quota_list.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_resource_quota_list.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_resource_quota_list.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | 21.933333 | 105 | 0.716312 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_resource_quota_list import V1ResourceQuotaList
class TestV1ResourceQuotaList(unittest.TestCase):
def setUp(self):
pass... | true | true |
f76b3a7c7d6874f160c65f0e09edc60bd003b0cb | 4,828 | py | Python | faebryk/exporters/netlist/graph.py | ruben-iteng/faebryk | 58810da4cb24581f421c39784ccf61e1a4ea8ae5 | [
"MIT"
] | 7 | 2021-11-22T20:02:14.000Z | 2022-03-04T19:35:04.000Z | faebryk/exporters/netlist/graph.py | ruben-iteng/faebryk | 58810da4cb24581f421c39784ccf61e1a4ea8ae5 | [
"MIT"
] | 45 | 2021-11-22T20:24:40.000Z | 2022-03-25T11:01:28.000Z | faebryk/exporters/netlist/graph.py | ruben-iteng/faebryk | 58810da4cb24581f421c39784ccf61e1a4ea8ae5 | [
"MIT"
] | 3 | 2021-11-22T19:58:08.000Z | 2021-12-17T16:14:08.000Z | # This file is part of the faebryk project
# SPDX-License-Identifier: MIT
import logging
logger = logging.getLogger("netlist")
def make_t1_netlist_from_graph(comps):
t1_netlist = [comp.get_comp() for comp in comps]
return t1_netlist
# This method is a temporary solution to convert high-level faebryk rela... | 36.300752 | 98 | 0.506214 |
import logging
logger = logging.getLogger("netlist")
def make_t1_netlist_from_graph(comps):
t1_netlist = [comp.get_comp() for comp in comps]
return t1_netlist
def make_graph_from_components(components):
from faebryk.library.core import Component
from faebryk.libs.exceptions import FaebrykExceptio... | true | true |
f76b3b431c53d928b4988cae318e4c90a87c8f77 | 7,276 | py | Python | scripts/figure10_experiment[static_solution_ssd]/plot_dca_static_ssd.py | SobhanOmranian/spark-dca | cd0c5ddbe433a1772442456549e37bf8838f75e3 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2020-02-07T12:09:14.000Z | 2020-03-09T21:31:40.000Z | scripts/figure10_experiment[static_solution_ssd]/plot_dca_static_ssd.py | SobhanOmranian/spark-dca | cd0c5ddbe433a1772442456549e37bf8838f75e3 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2020-05-15T21:45:35.000Z | 2021-01-21T00:21:21.000Z | scripts/figure10_experiment[static_solution_ssd]/plot_dca_static_ssd.py | SobhanOmranian/spark-dca | cd0c5ddbe433a1772442456549e37bf8838f75e3 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 3 | 2019-09-18T22:05:11.000Z | 2021-07-10T16:29:09.000Z | import matplotlib.pyplot as plt
from matplotlib.pyplot import savefig
import matplotlib.patches as mpatches
import pandas as pd
import numpy as np
from numpy import dtype
from matplotlib.pyplot import ylabel
import math
import re
import sys
sys.path.append(f'./common')
import util
from util import *
setup(util.settin... | 31.912281 | 115 | 0.635651 | import matplotlib.pyplot as plt
from matplotlib.pyplot import savefig
import matplotlib.patches as mpatches
import pandas as pd
import numpy as np
from numpy import dtype
from matplotlib.pyplot import ylabel
import math
import re
import sys
sys.path.append(f'./common')
import util
from util import *
setup(util.settin... | true | true |
f76b3b63cc6c6f9660bca91304464151ce3b1473 | 4,215 | py | Python | efficientdet/backbone/efficientnet_builder_test.py | shenghh2015/automl | 8c2cca6e35b1f27adf4ad709128aa586badc8a76 | [
"Apache-2.0"
] | 5 | 2020-03-31T08:19:39.000Z | 2020-11-24T16:59:19.000Z | efficientdet/backbone/efficientnet_builder_test.py | shenghh2015/automl | 8c2cca6e35b1f27adf4ad709128aa586badc8a76 | [
"Apache-2.0"
] | 1 | 2020-05-11T08:02:20.000Z | 2020-05-11T18:13:49.000Z | efficientdet/backbone/efficientnet_builder_test.py | shenghh2015/automl | 8c2cca6e35b1f27adf4ad709128aa586badc8a76 | [
"Apache-2.0"
] | 1 | 2020-10-30T10:08:40.000Z | 2020-10-30T10:08:40.000Z | # Copyright 2020 Google Research. 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... | 36.025641 | 80 | 0.711744 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import numpy as np
import tensorflow.compat.v1 as tf
from backbone import efficientnet_builder
class EfficientnetBuilderTest(tf.test.TestCase):
def _test_model_params(self,
... | true | true |
f76b3be5d220ee36458b38534890d5ea912ecb59 | 2,122 | py | Python | my/core/util.py | thetomcraig/HPI | 5eecd8721dc0cbfc68040106bb7b540b1567dff3 | [
"MIT"
] | null | null | null | my/core/util.py | thetomcraig/HPI | 5eecd8721dc0cbfc68040106bb7b540b1567dff3 | [
"MIT"
] | null | null | null | my/core/util.py | thetomcraig/HPI | 5eecd8721dc0cbfc68040106bb7b540b1567dff3 | [
"MIT"
] | null | null | null | from pathlib import Path
from itertools import chain
import os
import re
import pkgutil
from typing import List
# TODO reuse in readme/blog post
# borrowed from https://github.com/sanitizers/octomachinery/blob/24288774d6dcf977c5033ae11311dbff89394c89/tests/circular_imports_test.py#L22-L55
def _find_all_importables(pkg... | 25.566265 | 144 | 0.578699 | from pathlib import Path
from itertools import chain
import os
import re
import pkgutil
from typing import List
def _find_all_importables(pkg):
return sorted(
set(
chain.from_iterable(
_discover_path_importables(Path(p), pkg.__name__)
for p in pkg.__path__
... | true | true |
f76b3c1ffadddfdd44efa4b6950c91b7f14d1991 | 9,636 | py | Python | fedcloudclient/openstack.py | EGI-ILM/fedcloudclient | 6cbc4d2f048b6c6efc6d699a0c678176b3ff26d7 | [
"MIT"
] | 10 | 2021-02-09T06:51:37.000Z | 2022-03-04T19:26:11.000Z | fedcloudclient/openstack.py | EGI-ILM/fedcloudclient | 6cbc4d2f048b6c6efc6d699a0c678176b3ff26d7 | [
"MIT"
] | 44 | 2021-03-11T15:06:44.000Z | 2022-03-31T07:40:53.000Z | fedcloudclient/openstack.py | EGI-ILM/fedcloudclient | 6cbc4d2f048b6c6efc6d699a0c678176b3ff26d7 | [
"MIT"
] | 7 | 2021-03-22T11:23:11.000Z | 2022-03-01T10:31:20.000Z | """
Implementation of "fedcloud openstack" or "fedcloud openstack-int" for performing
OpenStack commands on sites
"""
import concurrent.futures
import json
import os
import subprocess # nosec Subprocess is required for invoking openstack client
import sys
from distutils.spawn import find_executable
import click
fro... | 27.769452 | 86 | 0.639269 |
import concurrent.futures
import json
import os
import subprocess import sys
from distutils.spawn import find_executable
import click
from fedcloudclient.decorators import (
ALL_SITES_KEYWORDS,
DEFAULT_AUTH_TYPE,
DEFAULT_IDENTITY_PROVIDER,
DEFAULT_PROTOCOL,
all_site_params,
oidc_params,
... | true | true |
f76b3c3865024171cabf20e3bdedfc8e3ee4c090 | 6,273 | py | Python | tensorflow_datasets/text/imdb.py | SiegeLordEx/datasets | 8e903c178eff14108a8b539ee88c6483669dbac1 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/imdb.py | SiegeLordEx/datasets | 8e903c178eff14108a8b539ee88c6483669dbac1 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/imdb.py | SiegeLordEx/datasets | 8e903c178eff14108a8b539ee88c6483669dbac1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | 36.47093 | 138 | 0.642595 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
import tensorflow_datasets.public_api as tfds
_DESCRIPTION = """\
Large Movie Review Dataset.
This is a dataset for binary sentiment classification containing substantially \
more data t... | true | true |
f76b3cbb2252db8fbc8c5c10056dfd54908228e5 | 199 | py | Python | envlogger/fuel/urls.py | aquatix/envlogger | c5667d06a46c1890d145e81ac430fc5d7a4c4bc4 | [
"Apache-2.0"
] | null | null | null | envlogger/fuel/urls.py | aquatix/envlogger | c5667d06a46c1890d145e81ac430fc5d7a4c4bc4 | [
"Apache-2.0"
] | 7 | 2017-12-18T15:10:29.000Z | 2021-12-12T11:21:47.000Z | envlogger/fuel/urls.py | aquatix/envlogger | c5667d06a46c1890d145e81ac430fc5d7a4c4bc4 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^<int:user_id>/dashboard/$', views.fueldashboard, name='fueldashboard'),
]
| 22.111111 | 82 | 0.673367 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^<int:user_id>/dashboard/$', views.fueldashboard, name='fueldashboard'),
]
| true | true |
f76b3d3c4f04bce9370e968e74a89f7527cac644 | 1,057 | py | Python | python/test/test_downward_api_volume_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 6 | 2021-02-18T14:37:54.000Z | 2022-01-13T13:27:43.000Z | python/test/test_downward_api_volume_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 14 | 2021-01-04T16:32:03.000Z | 2021-12-13T17:53:59.000Z | python/test/test_downward_api_volume_source.py | adriangonz/seldon-deploy-sdk | c5504838630a87053387cec57ec2e1e7251971e2 | [
"Apache-2.0"
] | 7 | 2021-03-17T09:05:55.000Z | 2022-01-05T10:39:56.000Z | # coding: utf-8
"""
Seldon Deploy API
API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501
OpenAPI spec version: v1alpha1
Contact: hello@seldon.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future... | 25.780488 | 122 | 0.740776 |
from __future__ import absolute_import
import unittest
import seldon_deploy_sdk
from seldon_deploy_sdk.models.downward_api_volume_source import DownwardAPIVolumeSource from seldon_deploy_sdk.rest import ApiException
class TestDownwardAPIVolumeSource(unittest.TestCase):
def setUp(self):
pass
de... | true | true |
f76b3d60161fdbca9750af35043d6c7a0b9710e7 | 47 | py | Python | stubs/cryptography/exceptions.py | joernheissler/cryptokey | d288a42c2234b7b48de23247a909c8f2d04398dd | [
"MIT"
] | null | null | null | stubs/cryptography/exceptions.py | joernheissler/cryptokey | d288a42c2234b7b48de23247a909c8f2d04398dd | [
"MIT"
] | 7 | 2019-02-26T14:55:40.000Z | 2020-03-27T13:31:55.000Z | stubs/cryptography/exceptions.py | joernheissler/cryptokey | d288a42c2234b7b48de23247a909c8f2d04398dd | [
"MIT"
] | null | null | null | class UnsupportedAlgorithm(Exception):
...
| 15.666667 | 38 | 0.723404 | class UnsupportedAlgorithm(Exception):
...
| true | true |
f76b3d98220672d3485c96c5a20c2f8458e6d871 | 1,534 | py | Python | bernoulli_nb/bnb_analysis.py | rnowling/pop-gen-models | 308079909c49a478787c103f2d2b8ee037ac6952 | [
"Apache-2.0"
] | null | null | null | bernoulli_nb/bnb_analysis.py | rnowling/pop-gen-models | 308079909c49a478787c103f2d2b8ee037ac6952 | [
"Apache-2.0"
] | null | null | null | bernoulli_nb/bnb_analysis.py | rnowling/pop-gen-models | 308079909c49a478787c103f2d2b8ee037ac6952 | [
"Apache-2.0"
] | null | null | null | import sys
from sklearn.naive_bayes import BernoulliNB as BNB
import matplotlib.pyplot as plt
import numpy as np
def read_variants(flname):
fl = open(flname)
markers = []
individuals = []
population_ids = []
population = -1
for ln in fl:
if "Marker" in ln:
if len(individuals) == 0:
continue
marker ... | 22.231884 | 79 | 0.698175 | import sys
from sklearn.naive_bayes import BernoulliNB as BNB
import matplotlib.pyplot as plt
import numpy as np
def read_variants(flname):
fl = open(flname)
markers = []
individuals = []
population_ids = []
population = -1
for ln in fl:
if "Marker" in ln:
if len(individuals) == 0:
continue
marker ... | false | true |
f76b3ddd80578b79db3fcd067c6b2cf9bf1c91ef | 254 | py | Python | prjGogistics/src/models/models_gcm.py | Gogistics/prjGogistics | ea24e0b1dc8b99570603a2f0d87d0aaaf2835717 | [
"MIT"
] | null | null | null | prjGogistics/src/models/models_gcm.py | Gogistics/prjGogistics | ea24e0b1dc8b99570603a2f0d87d0aaaf2835717 | [
"MIT"
] | null | null | null | prjGogistics/src/models/models_gcm.py | Gogistics/prjGogistics | ea24e0b1dc8b99570603a2f0d87d0aaaf2835717 | [
"MIT"
] | null | null | null | '''
Created on Jul 23, 2014
@author: user
'''
from google.appengine.ext import ndb
class GCMClientRegID(ndb.Model):
reg_id = ndb.StringProperty()
user_name = ndb.StringProperty()
created_date_time = ndb.DateTimeProperty(auto_now_add = True) | 23.090909 | 65 | 0.73622 | from google.appengine.ext import ndb
class GCMClientRegID(ndb.Model):
reg_id = ndb.StringProperty()
user_name = ndb.StringProperty()
created_date_time = ndb.DateTimeProperty(auto_now_add = True) | true | true |
f76b3ec666aab031c8bf831af01e8df82103e9b7 | 206 | py | Python | lambda_local/event.py | ksmoore17/python-lambda-local | cc566f52529acdc18a7d7fb4431b1aab97bc5e1b | [
"MIT"
] | 281 | 2015-10-26T07:25:13.000Z | 2022-03-09T07:06:37.000Z | lambda_local/event.py | ksmoore17/python-lambda-local | cc566f52529acdc18a7d7fb4431b1aab97bc5e1b | [
"MIT"
] | 47 | 2016-05-19T11:43:05.000Z | 2021-07-27T19:47:57.000Z | lambda_local/event.py | ksmoore17/python-lambda-local | cc566f52529acdc18a7d7fb4431b1aab97bc5e1b | [
"MIT"
] | 34 | 2015-10-29T03:32:28.000Z | 2022-02-03T04:11:59.000Z | '''
Copyright 2015-2020 HENNGE K.K. (formerly known as HDE, Inc.)
Licensed under MIT.
'''
import json
def read_event(path):
with open(path) as event:
data = json.load(event)
return data
| 14.714286 | 61 | 0.65534 |
import json
def read_event(path):
with open(path) as event:
data = json.load(event)
return data
| true | true |
f76b3f1f5db294a3175801f7db8880d61e3d159e | 3,441 | py | Python | Integration/Deployer/deployer_helper.py | gaurav-kc/IOT_Platform | 2fe770dff4927979919ef2ece966e5f0da467849 | [
"MIT"
] | 3 | 2021-07-12T05:20:27.000Z | 2021-07-14T01:32:29.000Z | Integration/Deployer/deployer_helper.py | gaurav-kc/IOT_Platform | 2fe770dff4927979919ef2ece966e5f0da467849 | [
"MIT"
] | null | null | null | Integration/Deployer/deployer_helper.py | gaurav-kc/IOT_Platform | 2fe770dff4927979919ef2ece966e5f0da467849 | [
"MIT"
] | 1 | 2020-05-19T10:13:13.000Z | 2020-05-19T10:13:13.000Z | import json
from flask import request
import requests
def generateDokerFile(user_config, service_name, sensor_topic,output_topic):
configfile = open(user_config, 'r')
config = json.load(configfile)
configfile.close()
df = open('dockerfile', 'w')
services = config['Application']['services']
environment = []
fg... | 28.915966 | 123 | 0.684685 | import json
from flask import request
import requests
def generateDokerFile(user_config, service_name, sensor_topic,output_topic):
configfile = open(user_config, 'r')
config = json.load(configfile)
configfile.close()
df = open('dockerfile', 'w')
services = config['Application']['services']
environment = []
fg... | true | true |
f76b3f4c82474c7487d6785d6f72a1ab50fd047f | 3,147 | py | Python | ws/src/lab/src/py_ctrl/predicates/state.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | 2 | 2022-02-22T13:36:41.000Z | 2022-02-22T13:39:41.000Z | ws/src/lab/src/py_ctrl/predicates/state.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | null | null | null | ws/src/lab/src/py_ctrl/predicates/state.py | Cobots-Kandidatarbete/cobots | 8186910e6d30569f95ed6ebe4645ba05ecc53864 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# In this file, the state class is defined that we will use to represent
# a state. You need to implement some of the missing functionality based
# on the failing tests.
#
# ------------------------------------------------------------------... | 37.464286 | 96 | 0.620591 |
from __future__ import annotations
from typing import Any, Optional
from dataclasses import dataclass
from predicates.errors import NotInStateException
@dataclass(frozen=True, order=True, init=False)
class State:
state: dict[str, Any]
def __init__(self, **kwargs) -> None:
object.__setat... | true | true |
f76b3fa540a9d21d39a9fc4fa6da5116319a09ee | 1,155 | py | Python | evaluate.py | franblas/facialrecoChallenge | db898eda760f09730b15240c6cb02a439b4858ca | [
"MIT"
] | null | null | null | evaluate.py | franblas/facialrecoChallenge | db898eda760f09730b15240c6cb02a439b4858ca | [
"MIT"
] | null | null | null | evaluate.py | franblas/facialrecoChallenge | db898eda760f09730b15240c6cb02a439b4858ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 16 17:45:25 2015
@author: Paco
"""
import matplotlib.pyplot as plt
import bisect
import numpy as np
from sklearn import metrics
class Evaluate(object):
_fpr = None
_tpr = None
def __init__(self): pass
def evaluation(self,pairs_label,dist):
... | 25.666667 | 73 | 0.57316 | """
Created on Tue Jun 16 17:45:25 2015
@author: Paco
"""
import matplotlib.pyplot as plt
import bisect
import numpy as np
from sklearn import metrics
class Evaluate(object):
_fpr = None
_tpr = None
def __init__(self): pass
def evaluation(self,pairs_label,dist):
fpr, tpr, thresho... | false | true |
f76b40cebf965b3ddab66ab7c4e134bd0b5009d2 | 2,196 | py | Python | PythonStudy/Tensorflow4mnist/mnist/v1/train.py | shenjl/PStudy | d49c710524781b604acf4cb3d28b774ab09ff73d | [
"MIT"
] | null | null | null | PythonStudy/Tensorflow4mnist/mnist/v1/train.py | shenjl/PStudy | d49c710524781b604acf4cb3d28b774ab09ff73d | [
"MIT"
] | 11 | 2020-01-28T23:06:51.000Z | 2022-02-10T00:35:09.000Z | PythonStudy/Tensorflow4mnist/mnist/v1/train.py | shenjl/PStudy | d49c710524781b604acf4cb3d28b774ab09ff73d | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from model import Network
'''
python 3.6
tensorflow 1.4
'''
class Train:
def __init__(self):
self.net = Network()
# 初始化 session
# Network() 只是构造了一张计算图,计算需要放到会话(session)中
self.sess = tf.Session()
... | 31.371429 | 94 | 0.596539 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from model import Network
class Train:
def __init__(self):
self.net = Network()
self.sess = tf.Session()
self.sess.run(tf.global_variables_initializer())
... | true | true |
f76b41c71ba8df14340e0aff7a0f13c02817d7af | 2,784 | py | Python | gatheros/gatheros_exec.py | operatorequals/gatheros | 97de61fc6cc1f2461fdc3abd9e71503f4bc17db8 | [
"BSD-3-Clause"
] | 13 | 2017-05-27T00:56:07.000Z | 2022-01-19T14:01:50.000Z | gatheros/gatheros_exec.py | operatorequals/gatheros | 97de61fc6cc1f2461fdc3abd9e71503f4bc17db8 | [
"BSD-3-Clause"
] | null | null | null | gatheros/gatheros_exec.py | operatorequals/gatheros | 97de61fc6cc1f2461fdc3abd9e71503f4bc17db8 | [
"BSD-3-Clause"
] | 2 | 2017-08-07T20:45:43.000Z | 2020-09-30T00:08:21.000Z | #!/usr/bin/env python
from execute.command_function import get_command_execute
from gatheros import __name__ as module_name
from execute.execution_unit import ExecutionUnit
import argparse
import sys, os
import json
base_dir = os.sep.join(__file__.split( os.sep )[:-1])
parser = argparse.ArgumentParser( description =... | 32 | 124 | 0.712284 | from execute.command_function import get_command_execute
from gatheros import __name__ as module_name
from execute.execution_unit import ExecutionUnit
import argparse
import sys, os
import json
base_dir = os.sep.join(__file__.split( os.sep )[:-1])
parser = argparse.ArgumentParser( description = "A tool for remote sy... | false | true |
f76b41cfb3a6211111d73d22f1a3132de2969072 | 10,695 | py | Python | exchangelib/extended_properties.py | agaridata/exchangelib | 8a572f1da624142a250769946160ee2f4450237c | [
"BSD-2-Clause"
] | null | null | null | exchangelib/extended_properties.py | agaridata/exchangelib | 8a572f1da624142a250769946160ee2f4450237c | [
"BSD-2-Clause"
] | null | null | null | exchangelib/extended_properties.py | agaridata/exchangelib | 8a572f1da624142a250769946160ee2f4450237c | [
"BSD-2-Clause"
] | 1 | 2020-03-04T12:31:26.000Z | 2020-03-04T12:31:26.000Z | from __future__ import unicode_literals
import base64
import logging
from decimal import Decimal
from six import string_types
from .ewsdatetime import EWSDateTime
from .properties import EWSElement
from .services import TNS
from .util import create_element, add_xml_child, get_xml_attrs, get_xml_attr, set_xml_value, ... | 39.758364 | 120 | 0.621225 | from __future__ import unicode_literals
import base64
import logging
from decimal import Decimal
from six import string_types
from .ewsdatetime import EWSDateTime
from .properties import EWSElement
from .services import TNS
from .util import create_element, add_xml_child, get_xml_attrs, get_xml_attr, set_xml_value, ... | true | true |
f76b41fa774d847ec955e704ca7813267abb1e84 | 21,637 | py | Python | pyvista/utilities/geometric_objects.py | JevinJ/pyvista | c9be18ed209de3f80e1a70ef01eef3355b3616ce | [
"MIT"
] | null | null | null | pyvista/utilities/geometric_objects.py | JevinJ/pyvista | c9be18ed209de3f80e1a70ef01eef3355b3616ce | [
"MIT"
] | null | null | null | pyvista/utilities/geometric_objects.py | JevinJ/pyvista | c9be18ed209de3f80e1a70ef01eef3355b3616ce | [
"MIT"
] | null | null | null | """Provides an easy way of generating several geometric objects.
CONTAINS
--------
vtkArrowSource
vtkCylinderSource
vtkSphereSource
vtkPlaneSource
vtkLineSource
vtkCubeSource
vtkConeSource
vtkDiskSource
vtkRegularPolygonSource
vtkPyramid
"""
import numpy as np
import vtk
import pyvista
from pyvista.utilities import ... | 29.081989 | 104 | 0.638721 | import numpy as np
import vtk
import pyvista
from pyvista.utilities import assert_empty_kwargs, check_valid_vector
NORMALS = {
'x': [1, 0, 0],
'y': [0, 1, 0],
'z': [0, 0, 1],
'-x': [-1, 0, 0],
'-y': [0, -1, 0],
'-z': [0, 0, -1],
}
def translate(surf, center=[0., 0., 0.], direction=[1., 0., 0... | true | true |
f76b429f3531c7a04fc56e563ead78f0342e392e | 2,474 | py | Python | examples/2d/subduction/viz/plot_slipprofile.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | examples/2d/subduction/viz/plot_slipprofile.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | examples/2d/subduction/viz/plot_slipprofile.py | joegeisz/pylith | f74060b7b19d7e90abf8597bbe9250c96593c0ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script generates a plot showing slip or fault tractions.
"""
# The code requires the numpy, h5py, and matplotlib packages.
import numpy
import h5py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as pyplot
# -------------------------------------------------------------... | 27.186813 | 78 | 0.52789 |
import numpy
import h5py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as pyplot
def calcDist(vertices):
dist = numpy.zeros(vertices.shape[0])
pt0 = vertices[:-1,:]
pt1 = vertices[1:,:]
dx = ((pt1[:,0]-pt0[:,0])**2 + (pt1[:,1]-pt0[:,1])**2)**0.5
dist[1:] = numpy.cumsum(dx)
... | true | true |
f76b431f23703cac89b8f9be81291ac3eb422d83 | 4,383 | py | Python | src/backend/common/helpers/tests/predictions_helper_test.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/common/helpers/tests/predictions_helper_test.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/common/helpers/tests/predictions_helper_test.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | import json
import pytest
from google.appengine.ext import ndb
from backend.common.consts.alliance_color import AllianceColor
from backend.common.helpers.match_helper import MatchHelper
from backend.common.helpers.prediction_helper import PredictionHelper
from backend.common.models.event import Event
from backend.com... | 32.227941 | 87 | 0.716632 | import json
import pytest
from google.appengine.ext import ndb
from backend.common.consts.alliance_color import AllianceColor
from backend.common.helpers.match_helper import MatchHelper
from backend.common.helpers.prediction_helper import PredictionHelper
from backend.common.models.event import Event
from backend.com... | true | true |
f76b43533be393888a8c751f003a2be7ddca32ca | 7,480 | py | Python | Word2Vec/OtherReports/TensforFlow/scripts/preprocess.py | sljlp/Perf | 033f0d3197e5b840a3ce7a3a814c901ef66b72f1 | [
"Apache-2.0"
] | 12 | 2020-12-18T10:06:43.000Z | 2022-02-14T01:41:34.000Z | Word2Vec/OtherReports/TensforFlow/scripts/preprocess.py | sljlp/Perf | 033f0d3197e5b840a3ce7a3a814c901ef66b72f1 | [
"Apache-2.0"
] | 6 | 2020-12-19T09:14:49.000Z | 2022-01-25T03:47:11.000Z | Word2Vec/OtherReports/TensforFlow/scripts/preprocess.py | sljlp/Perf | 033f0d3197e5b840a3ce7a3a814c901ef66b72f1 | [
"Apache-2.0"
] | 43 | 2020-12-18T07:49:21.000Z | 2022-02-14T01:42:55.000Z | # -*- coding: utf-8 -*
import os
import random
import re
import six
import argparse
import io
import math
prog = re.compile("[^a-z ]", flags=0)
def parse_args():
parser = argparse.ArgumentParser(
description="Paddle Fluid word2 vector preprocess")
parser.add_argument(
'--build_dict_corpus_dir'... | 31.694915 | 134 | 0.55508 | import os
import random
import re
import six
import argparse
import io
import math
prog = re.compile("[^a-z ]", flags=0)
def parse_args():
parser = argparse.ArgumentParser(
description="Paddle Fluid word2 vector preprocess")
parser.add_argument(
'--build_dict_corpus_dir', type=str, help="The d... | true | true |
f76b43f7aa7e8080ebc49ad033126eaf6e2c534d | 472 | py | Python | testeMult2.py | gabrielbastoos/FaceRecognition-with-Multiprocessing | 68d5a46f2c59af66c7bbf2d522c95e45bdda6b90 | [
"MIT"
] | 2 | 2018-10-07T04:54:48.000Z | 2018-10-07T04:54:57.000Z | testeMult2.py | gabrielbastoos/FaceRecognition-with-Multiprocessing | 68d5a46f2c59af66c7bbf2d522c95e45bdda6b90 | [
"MIT"
] | null | null | null | testeMult2.py | gabrielbastoos/FaceRecognition-with-Multiprocessing | 68d5a46f2c59af66c7bbf2d522c95e45bdda6b90 | [
"MIT"
] | null | null | null | import os
def doTheJob(job,state):
for i in range(100000):
print (job, i)
state = True
return state
jobs = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
imTheFather = True
children = []
for job in jobs:
child = os.fork()
if child:
children.append(child)
print (children)
else:
imTheFather = F... | 16.275862 | 57 | 0.627119 | import os
def doTheJob(job,state):
for i in range(100000):
print (job, i)
state = True
return state
jobs = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
imTheFather = True
children = []
for job in jobs:
child = os.fork()
if child:
children.append(child)
print (children)
else:
imTheFather = F... | false | true |
f76b4492ab22ff482c7d4bd428f32ae8438d715d | 4,028 | py | Python | utils/io_utils.py | artificially-ai/FewShotVision | 02c1132828bc9caba4cadd0b2f731bd63f66b826 | [
"MIT"
] | 90 | 2019-10-03T01:13:09.000Z | 2022-03-24T09:02:08.000Z | utils/io_utils.py | artificially-ai/FewShotVision | 02c1132828bc9caba4cadd0b2f731bd63f66b826 | [
"MIT"
] | 3 | 2020-04-07T13:03:43.000Z | 2020-09-03T08:06:45.000Z | utils/io_utils.py | ebennequin/FewShotVision | 909bc414ea27ef0300091e1dd6baba4fb063324b | [
"MIT"
] | 12 | 2019-12-25T05:49:56.000Z | 2021-05-22T11:58:19.000Z | import glob
import os
import numpy as np
import torch
from utils import configs, backbones
model_dict = dict(
Conv4=backbones.Conv4,
Conv4S=backbones.Conv4S,
Conv6=backbones.Conv6,
ResNet10=backbones.ResNet10,
ResNet18=backbones.ResNet18,
ResNet34=backbones.ResNet34,
ResNet50=backbones.Re... | 32.224 | 119 | 0.670804 | import glob
import os
import numpy as np
import torch
from utils import configs, backbones
model_dict = dict(
Conv4=backbones.Conv4,
Conv4S=backbones.Conv4S,
Conv6=backbones.Conv6,
ResNet10=backbones.ResNet10,
ResNet18=backbones.ResNet18,
ResNet34=backbones.ResNet34,
ResNet50=backbones.Re... | true | true |
f76b44f9df3a08d1dafcc27e68d0c5cbaf1f47ee | 1,574 | py | Python | doc/sphinxext/contributors.py | odidev/bottleneck | bcfdfa8b1ee6787ca396146a55d969ddbbf62da5 | [
"BSD-2-Clause"
] | 1 | 2020-02-24T10:03:25.000Z | 2020-02-24T10:03:25.000Z | doc/sphinxext/contributors.py | odidev/bottleneck | bcfdfa8b1ee6787ca396146a55d969ddbbf62da5 | [
"BSD-2-Clause"
] | null | null | null | doc/sphinxext/contributors.py | odidev/bottleneck | bcfdfa8b1ee6787ca396146a55d969ddbbf62da5 | [
"BSD-2-Clause"
] | null | null | null | """This file is copied from pandas.doc.sphinxext.contributors
Sphinx extension for listing code contributors to a release.
Usage::
.. contributors:: v0.23.0..v0.23.1
This will be replaced with a message indicating the number of
code contributors and commits, and then list each contributor
individually.
"""
from ... | 29.148148 | 86 | 0.625794 | from announce import build_components
from docutils import nodes
from docutils.parsers.rst import Directive
import git
class ContributorsDirective(Directive):
required_arguments = 1
name = "contributors"
def run(self):
range_ = self.arguments[0]
if range_.endswith("x..HEAD"):
... | true | true |
f76b45516968ca6bd993ca5f82ada539864ecc84 | 1,923 | py | Python | migrations/versions/9b6260e9ca85_create_new_database_for_the_project.py | VGichuki/blog_app | 44f2084bae5855f99e0540e37344baa3f8d3d840 | [
"Unlicense"
] | null | null | null | migrations/versions/9b6260e9ca85_create_new_database_for_the_project.py | VGichuki/blog_app | 44f2084bae5855f99e0540e37344baa3f8d3d840 | [
"Unlicense"
] | null | null | null | migrations/versions/9b6260e9ca85_create_new_database_for_the_project.py | VGichuki/blog_app | 44f2084bae5855f99e0540e37344baa3f8d3d840 | [
"Unlicense"
] | null | null | null | """Create new database for the project
Revision ID: 9b6260e9ca85
Revises:
Create Date: 2021-06-21 11:13:54.880591
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9b6260e9ca85'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ... | 33.155172 | 67 | 0.662507 | from alembic import op
import sqlalchemy as sa
revision = '9b6260e9ca85'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=255), nullable=True),
sa.Column('emai... | true | true |
f76b4590feef8a261f6491ee864b68ecf4fca2bb | 1,695 | py | Python | splitio/util/threadutil.py | cfogg/python-client | 40e6891c8240e6b2acd5df538e622e9f15de43d6 | [
"Apache-2.0"
] | null | null | null | splitio/util/threadutil.py | cfogg/python-client | 40e6891c8240e6b2acd5df538e622e9f15de43d6 | [
"Apache-2.0"
] | null | null | null | splitio/util/threadutil.py | cfogg/python-client | 40e6891c8240e6b2acd5df538e622e9f15de43d6 | [
"Apache-2.0"
] | null | null | null | """Threading utilities."""
from inspect import isclass
import threading
# python2 workaround
_EventClass = threading.Event if isclass(threading.Event) else threading._Event #pylint:disable=protected-access,invalid-name
class EventGroup(object):
"""EventGroup that can be waited with an OR condition."""
cla... | 29.736842 | 126 | 0.621829 | from inspect import isclass
import threading
_EventClass = threading.Event if isclass(threading.Event) else threading._Event
class EventGroup(object):
class Event(_EventClass):
def __init__(self, shared_condition):
_EventClass.__init__(self)
self._shared_cond = shared_conditi... | true | true |
f76b45b991d86c1664dcba4675c1d3e5ef0770e4 | 3,611 | py | Python | google/ads/google_ads/v4/proto/errors/reach_plan_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v4/proto/errors/reach_plan_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v4/proto/errors/reach_plan_error_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v4/proto/errors/reach_plan_error.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf impor... | 38.010526 | 577 | 0.791471 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
f76b462448bd3ff8816a22c156f9676e78a6ace7 | 449 | py | Python | thirdpart/asn1_t.py | by46/geek | 04b08d0dff80c524bd471ead3fe524423eebf123 | [
"MIT"
] | null | null | null | thirdpart/asn1_t.py | by46/geek | 04b08d0dff80c524bd471ead3fe524423eebf123 | [
"MIT"
] | null | null | null | thirdpart/asn1_t.py | by46/geek | 04b08d0dff80c524bd471ead3fe524423eebf123 | [
"MIT"
] | null | null | null | import asn1
def main():
byte_string = '\x17\x00' \
'\x00\x00\x01\x00\x00\x00\x00\x00' \
'\x3B\x06\x70\xad\x00\x00\x0a\x00' \
'\x05\x00\x00\x00\x30\x03\x0a\x01' \
'\x01'
decoder = asn1.Decoder()
decoder.start(byte_string)
... | 28.0625 | 55 | 0.494432 | import asn1
def main():
byte_string = '\x17\x00' \
'\x00\x00\x01\x00\x00\x00\x00\x00' \
'\x3B\x06\x70\xad\x00\x00\x0a\x00' \
'\x05\x00\x00\x00\x30\x03\x0a\x01' \
'\x01'
decoder = asn1.Decoder()
decoder.start(byte_string)
... | false | true |
f76b464e6ddc7d26bb71932558f5925d3f226ce9 | 3,499 | py | Python | sat_lib/process_bands.py | phaustin/a301_2020 | 9be7ead5f641013e2cec4e736ea76171b849e8d5 | [
"BSD-3-Clause"
] | 1 | 2021-01-26T03:59:16.000Z | 2021-01-26T03:59:16.000Z | sat_lib/process_bands.py | phaustin/a301_2020 | 9be7ead5f641013e2cec4e736ea76171b849e8d5 | [
"BSD-3-Clause"
] | null | null | null | sat_lib/process_bands.py | phaustin/a301_2020 | 9be7ead5f641013e2cec4e736ea76171b849e8d5 | [
"BSD-3-Clause"
] | 1 | 2021-02-01T09:55:18.000Z | 2021-02-01T09:55:18.000Z | import a301_lib
import numpy as np
from matplotlib import pyplot as plt
from pyhdf.SD import SD
from pyhdf.SD import SDC
from pathlib import Path
import h5py
from contextlib import contextmanager
import os
from sat_lib.modismeta_read import get_core
@contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdi... | 32.100917 | 91 | 0.615604 | import a301_lib
import numpy as np
from matplotlib import pyplot as plt
from pyhdf.SD import SD
from pyhdf.SD import SDC
from pathlib import Path
import h5py
from contextlib import contextmanager
import os
from sat_lib.modismeta_read import get_core
@contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdi... | true | true |
f76b46803457256da0f70e1dafb45e853c8d7f42 | 3,785 | py | Python | More/E02_Flat/E12_TextSize.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | More/E02_Flat/E12_TextSize.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | More/E02_Flat/E12_TextSize.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# Supporting Flat, xxyxyz.org/flat
# -----------------------------------------------------------------------------
#
# E... | 35.046296 | 86 | 0.721532 |
import os
from flat import rgb, font, shape, strike, document, paragraph, text
from pagebot.fonttoolbox.objects.font import findFont
from pagebot.toolbox.loremipsum import loremIpsum
EXPORT_PATH = '_export/12_TextSize.pdf'
if not os.path.exists('_export'):
os.mkdir('_export')
W, H = 1000, 1000
R = 20
pbFont = fin... | true | true |
f76b46b741b9dbace482e5583e904326e5cbbfb7 | 2,257 | py | Python | simulation/device/real/light/light.py | LBNL-ETA/LPDM | 3384a784b97e49cd7a801b758717a7107a51119f | [
"BSD-3-Clause-LBNL"
] | 2 | 2019-01-05T02:33:38.000Z | 2020-04-22T16:57:50.000Z | simulation/device/real/light/light.py | LBNL-ETA/LPDM | 3384a784b97e49cd7a801b758717a7107a51119f | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-04-17T18:13:08.000Z | 2021-04-23T22:40:23.000Z | simulation/device/real/light/light.py | LBNL-ETA/LPDM | 3384a784b97e49cd7a801b758717a7107a51119f | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-01-31T08:37:44.000Z | 2019-01-31T08:37:44.000Z |
################################################################################################################################
# *** Copyright Notice ***
#
# "Price Based Local Power Distribution Management System (Local Power Distribution Manager) v1.0"
# Copyright (c) 2016, The Regents of the University of Calif... | 41.036364 | 128 | 0.60833 |
################################################################################################################################
from eud import Eud
from wemo_control.wemo_light import WemoLight
class Light(Eud):
def __init__(self, config = None):
# call the super constructor
Eud.__init__(self, ... | true | true |
f76b471c36c9ec4f8aefa8be668c745a6327b52a | 10,391 | py | Python | src/pipelines/classic.py | Klimorg/template_segmentation | f5a5066905acb06c66793d9a361eae8570652af2 | [
"Apache-2.0"
] | 1 | 2022-02-01T06:54:22.000Z | 2022-02-01T06:54:22.000Z | src/pipelines/classic.py | Klimorg/template_segmentation | f5a5066905acb06c66793d9a361eae8570652af2 | [
"Apache-2.0"
] | 34 | 2021-11-01T14:19:35.000Z | 2022-03-28T14:25:35.000Z | src/pipelines/classic.py | Klimorg/template_segmentation | f5a5066905acb06c66793d9a361eae8570652af2 | [
"Apache-2.0"
] | null | null | null | from typing import List, Tuple
import albumentations as A
import numpy as np
import pandas as pd
import tensorflow as tf
from src.pipelines.base_pipeline import BasePipeline
# class Tensorize(object):
# """
# Class used to create tensor datasets for TensorFlow.
# Inheritance:
# object: The base ... | 33.846906 | 110 | 0.575691 | from typing import List, Tuple
import albumentations as A
import numpy as np
import pandas as pd
import tensorflow as tf
from src.pipelines.base_pipeline import BasePipeline
# Class used to create tensor datasets for TensorFlow.
# Inheritance:
# object: The base class of the class hierarchy, used on... | true | true |
f76b4729f96f36e5652e3c2cf960e515bf3cfcd2 | 4,790 | py | Python | configs/feet/gnws.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | configs/feet/gnws.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | configs/feet/gnws.py | ryohachiuma/DFU-challenge | 08401bfde9bcb1abcb32ef060e89b8c135e7f3f1 | [
"Apache-2.0"
] | null | null | null | # dataset settings
_base_ = '../gn+ws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco.py'
dataset_type = 'MyDataset'
data_root = './datasets/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
albu_train_transforms = [
dict(
type='ShiftScaleRotate',
shi... | 27.528736 | 201 | 0.56952 | _base_ = '../gn+ws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco.py'
dataset_type = 'MyDataset'
data_root = './datasets/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
albu_train_transforms = [
dict(
type='ShiftScaleRotate',
shift_limit=0.0625,
... | true | true |
f76b47676b9cf7bfac10a1eb7f0959d89c69b248 | 1,894 | py | Python | setup.py | Erovia/qmk_cli | 120ce557f18cc115ec24097a203b798c577e46a1 | [
"MIT"
] | null | null | null | setup.py | Erovia/qmk_cli | 120ce557f18cc115ec24097a203b798c577e46a1 | [
"MIT"
] | null | null | null | setup.py | Erovia/qmk_cli | 120ce557f18cc115ec24097a203b798c577e46a1 | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from setuptools import setup, find_packages
setup_cfg = ConfigParser()
setup_cfg.read('setup.cfg')
metadata = setup_cfg['metadata']
if __name__ == "__main__":
with open('README.md', encoding='utf-8') as readme_file:
long_description=readme_file.read()
setup(
... | 35.735849 | 90 | 0.576558 | from configparser import ConfigParser
from setuptools import setup, find_packages
setup_cfg = ConfigParser()
setup_cfg.read('setup.cfg')
metadata = setup_cfg['metadata']
if __name__ == "__main__":
with open('README.md', encoding='utf-8') as readme_file:
long_description=readme_file.read()
setup(
... | true | true |
f76b480f7e362847afd343e341f3ea7b034aa3c5 | 6,969 | py | Python | hiren/settings.py | pyprism/Aurora | ed8bda0d6e89be578bda45b9ef730ab07ff9c259 | [
"MIT"
] | null | null | null | hiren/settings.py | pyprism/Aurora | ed8bda0d6e89be578bda45b9ef730ab07ff9c259 | [
"MIT"
] | null | null | null | hiren/settings.py | pyprism/Aurora | ed8bda0d6e89be578bda45b9ef730ab07ff9c259 | [
"MIT"
] | null | null | null | """
Django settings for hiren project.
Generated by 'django-admin startproject' using Django 2.0.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
import... | 26.397727 | 91 | 0.591764 |
import os
import json
import datetime
import raven
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
try:
with open(BASE_DIR + '/' + 'config.local.json') as f:
JSON_DATA = json.load(f)
except FileNotFoundError:
with open(BASE_DIR + '/' + 'config.json') as f:
JSON_DATA = ... | true | true |
f76b48d1a9915c7755fc22474420e6b8e8058ca7 | 5,354 | py | Python | src/pbrdna/fastq/QualityTrimmer.py | icefoxx/rDnaTools | d184ffece7902dacddc278636eb806ab3697208b | [
"BSD-3-Clause"
] | 1 | 2017-10-28T03:36:01.000Z | 2017-10-28T03:36:01.000Z | src/pbrdna/fastq/QualityTrimmer.py | icefoxx/rDnaTools | d184ffece7902dacddc278636eb806ab3697208b | [
"BSD-3-Clause"
] | null | null | null | src/pbrdna/fastq/QualityTrimmer.py | icefoxx/rDnaTools | d184ffece7902dacddc278636eb806ab3697208b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import re
import logging
from numpy import where
from pbrdna.io.FastqIO import FastqReader, FastqRecord, FastqWriter
__version__ = "0.1"
MIN_QV = None
MIN_LENGTH = 100
class QualityTrimmer(object):
"""
Tool for trimming low-quality bases from the ends of FASTQ fi... | 36.924138 | 95 | 0.574897 |
import sys
import os
import re
import logging
from numpy import where
from pbrdna.io.FastqIO import FastqReader, FastqRecord, FastqWriter
__version__ = "0.1"
MIN_QV = None
MIN_LENGTH = 100
class QualityTrimmer(object):
def __init__(self, fastqFile=None,
outputFile=None,
... | true | true |
f76b4acdfeb9f5ab2e7b3ae783ebf978203a3984 | 9,547 | py | Python | container_sdk/model/easy_command/task_spec_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | container_sdk/model/easy_command/task_spec_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | container_sdk/model/easy_command/task_spec_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: task_spec.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | 51.88587 | 1,043 | 0.756468 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
f76b4af95f4babfe0d5a4a85b99bb173e897f958 | 1,743 | py | Python | tests/test_issues/test_issue_113.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 25 | 2019-07-05T01:16:18.000Z | 2021-03-22T20:49:25.000Z | tests/test_issues/test_issue_113.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 299 | 2019-03-05T15:15:30.000Z | 2021-04-08T23:25:41.000Z | tests/test_issues/test_issue_113.py | deepakunni3/biolinkml | ca3567a59297e585d7f384df9d5c0bc9fecdb0b7 | [
"CC0-1.0"
] | 19 | 2019-05-23T17:46:47.000Z | 2021-03-25T06:45:55.000Z | import os
import unittest
from jsonasobj import as_json
from biolinkml.generators.pythongen import PythonGenerator
from tests.test_issues.environment import env
from tests.utils.python_comparator import compare_python, compile_python
from tests.utils.test_environment import TestEnvironmentTestCase
class Issue113Tes... | 40.534884 | 103 | 0.64716 | import os
import unittest
from jsonasobj import as_json
from biolinkml.generators.pythongen import PythonGenerator
from tests.test_issues.environment import env
from tests.utils.python_comparator import compare_python, compile_python
from tests.utils.test_environment import TestEnvironmentTestCase
class Issue113Tes... | true | true |
f76b4b229e5870af120a6158cfe082b1644fa592 | 2,296 | py | Python | camp/basecamp/models.py | harpb/public-camp | fe001eac274793be37a3bf6868b86f5a6bc9bf15 | [
"MIT"
] | null | null | null | camp/basecamp/models.py | harpb/public-camp | fe001eac274793be37a3bf6868b86f5a6bc9bf15 | [
"MIT"
] | null | null | null | camp/basecamp/models.py | harpb/public-camp | fe001eac274793be37a3bf6868b86f5a6bc9bf15 | [
"MIT"
] | null | null | null |
from django.contrib.auth.models import User
from django.db import models
from django.db.models import CASCADE
class Camp(models.Model):
'''
Camp is the thing everyone goes to in the summer to have fun
'''
name = models.CharField(max_length=256)
start_at = models.DateTimeField()
end_at = model... | 26.090909 | 97 | 0.649826 |
from django.contrib.auth.models import User
from django.db import models
from django.db.models import CASCADE
class Camp(models.Model):
name = models.CharField(max_length=256)
start_at = models.DateTimeField()
end_at = models.DateTimeField()
created_at = models.DateTimeField(auto_now_add=True, null=... | true | true |
f76b4bcddad4db406371613bfbd3d3bdce34d5d3 | 3,745 | py | Python | Backtracking/N_Queens.py | siddhi-244/CompetitiveProgrammingQuestionBank | 4c265d41b82a7d4370c14d367f78effa9ed95d3c | [
"MIT"
] | 931 | 2020-04-18T11:57:30.000Z | 2022-03-31T15:15:39.000Z | Backtracking/N_Queens.py | geekySapien/CompetitiveProgrammingQuestionBank | 9e84a88a85dbabd95207391967abde298ddc031d | [
"MIT"
] | 661 | 2020-12-13T04:31:48.000Z | 2022-03-15T19:11:54.000Z | Backtracking/N_Queens.py | geekySapien/CompetitiveProgrammingQuestionBank | 9e84a88a85dbabd95207391967abde298ddc031d | [
"MIT"
] | 351 | 2020-08-10T06:49:21.000Z | 2022-03-25T04:02:12.000Z | '''
Aim: To place N queens in a N*N Chessboard such that no two queens
attack each other. A queen is said to be attacked by another queen
if they share same diagonal(right/left), Row or Column.
Intution: Since there could be only one queen in each row, we can assume the
N*N chessboard to be a 1... | 33.738739 | 90 | 0.449933 |
def n_queens(board_size):
diagonal1 = {}
diagonal2 = {}
Col = {}
ans = place_queen(0, [], board_size, diagonal1, diagonal2, Col)
return ans
def place_queen(row, a, n, diagonal1, diagonal2, Col):
if(row == n):
return a
R = row + 1
for C in range... | true | true |
f76b4bfad2ed8c10210f02e059049589196e1d33 | 5,265 | py | Python | 3rd/byzauth/tools/mail_trace_scripts/bootstrapping.py | ShoufuLuo/csaw | 0d030d5ab93e61b62dff10b27a15c83fcfce3ff3 | [
"Apache-2.0"
] | null | null | null | 3rd/byzauth/tools/mail_trace_scripts/bootstrapping.py | ShoufuLuo/csaw | 0d030d5ab93e61b62dff10b27a15c83fcfce3ff3 | [
"Apache-2.0"
] | null | null | null | 3rd/byzauth/tools/mail_trace_scripts/bootstrapping.py | ShoufuLuo/csaw | 0d030d5ab93e61b62dff10b27a15c83fcfce3ff3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -tOO
#
# Generate the trusted group by using only
# local heuristics based on sent and receive
# connectivity in the email graph
import string
import re
from traceparser import traceparser
import sys
import random
class bootstrapping:
''' For each message in the trace, collect all to ad... | 31.716867 | 115 | 0.532004 |
import string
import re
from traceparser import traceparser
import sys
import random
class bootstrapping:
''' For each message in the trace, collect all to addresses it is sent
to. Generate a count of messages for a given from to tuple
The graph is stored in forward and backward direction.
'''... | false | true |
f76b4e462159c4affda0832d759f20bb1d58b6ac | 70,772 | py | Python | lib/sqlalchemy/sql/type_api.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/type_api.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/type_api.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | # sql/types_api.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
from __future__ import annotations
import typing
from ty... | 36.05298 | 85 | 0.639858 |
from __future__ import annotations
import typing
from typing import Any
from typing import Callable
from typing import Generic
from typing import Optional
from typing import Tuple
from typing import Type
from typing import TypeVar
from typing import Union
from .base import SchemaEventTarget
from .cache_key import N... | true | true |
f76b4fcfed4d5882630a4bbf11e29c8e96a84350 | 460 | py | Python | LnkParse3/target/internet.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 6 | 2019-04-16T10:19:15.000Z | 2022-03-18T22:21:18.000Z | LnkParse3/target/internet.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 12 | 2020-09-15T08:02:48.000Z | 2021-07-19T13:52:57.000Z | LnkParse3/target/internet.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 3 | 2019-10-10T06:38:48.000Z | 2020-10-25T08:24:34.000Z | from LnkParse3.target.lnk_target_base import LnkTargetBase
# https://github.com/libyal/libfwsi/blob/master/documentation/Windows%20Shell%20Item%20format.asciidoc#37-uri-shell-item
# TODO: rename to uri
class Internet(LnkTargetBase):
# TODO Not implemented
def __init__(self, *args, **kwargs):
self.name... | 30.666667 | 120 | 0.7 | from LnkParse3.target.lnk_target_base import LnkTargetBase
class Internet(LnkTargetBase):
def __init__(self, *args, **kwargs):
self.name = "Internet"
return super().__init__(*args, **kwargs)
def as_item(self):
item = super().as_item()
return item
| true | true |
f76b502c90af18c7f6af64a4a39f9938d28ada8b | 8,273 | py | Python | env/lib/python3.4/site-packages/social/backends/facebook.py | marto-k/pettify-1 | 6d6ab498b2b53559419fc8b523150ce60d40b081 | [
"MIT"
] | 7 | 2017-11-17T01:21:09.000Z | 2021-03-25T09:55:50.000Z | env/lib/python3.4/site-packages/social/backends/facebook.py | marto-k/pettify-1 | 6d6ab498b2b53559419fc8b523150ce60d40b081 | [
"MIT"
] | 19 | 2019-09-25T19:03:41.000Z | 2021-06-25T15:26:41.000Z | env/lib/python3.4/site-packages/social/backends/facebook.py | marto-k/pettify-1 | 6d6ab498b2b53559419fc8b523150ce60d40b081 | [
"MIT"
] | 3 | 2017-09-27T22:38:30.000Z | 2018-06-05T15:15:39.000Z | """
Facebook OAuth2 and Canvas Application backends, docs at:
http://psa.matiasaguirre.net/docs/backends/facebook.html
"""
import hmac
import time
import json
import base64
import hashlib
from social.utils import parse_qs, constant_time_compare, handle_http_errors
from social.backends.oauth import BaseOAuth2
from ... | 39.208531 | 78 | 0.611991 | import hmac
import time
import json
import base64
import hashlib
from social.utils import parse_qs, constant_time_compare, handle_http_errors
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthException, AuthCanceled, AuthUnknownError, \
AuthMissingParameter
... | true | true |
f76b515492ad38ccfde44563ad6e0d31d65e6266 | 1,187 | py | Python | env/bin/rst2html5.py | nobac3/uploadfile-flask-docker | 7b23fcf260c8e64a8255a5a7016953aa84ca3d77 | [
"Apache-2.0"
] | null | null | null | env/bin/rst2html5.py | nobac3/uploadfile-flask-docker | 7b23fcf260c8e64a8255a5a7016953aa84ca3d77 | [
"Apache-2.0"
] | null | null | null | env/bin/rst2html5.py | nobac3/uploadfile-flask-docker | 7b23fcf260c8e64a8255a5a7016953aa84ca3d77 | [
"Apache-2.0"
] | null | null | null | #!/Users/antoinecabon/Desktop/uploadfile-flask-docker/env/bin/python3.7
# -*- coding: utf8 -*-
# :Copyright: © 2015 Günter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium wi... | 32.972222 | 78 | 0.724516 |
try:
import locale locale.setlocale(locale.LC_ALL, '')
except locale.Error:
pass
from docutils.core import publish_cmdline, default_description
description = (u'Generates HTML 5 documents from standalone '
u'reStructuredText sources '
+ default_description)
publish_cmdline... | true | true |
f76b51899ba6ebc1fa13cd806f2dbd0403f40245 | 2,664 | py | Python | google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py | ivanmkc/python-aiplatform | 151ed11f6da8e3e0bee5749d360d9a4b135ad988 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py | ivanmkc/python-aiplatform | 151ed11f6da8e3e0bee5749d360d9a4b135ad988 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py | ivanmkc/python-aiplatform | 151ed11f6da8e3e0bee5749d360d9a4b135ad988 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.52 | 87 | 0.688814 |
import proto
from google.protobuf import duration_pb2 as duration from google.protobuf import wrappers_pb2 as wrappers
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.prediction",
manifest={"VideoActionRecognitionPredictionResult",},
)
class VideoActionRecognition... | true | true |
f76b53e89962754cbfabe215e5c6cc097c4549d9 | 3,249 | py | Python | isi_sdk_8_1_0/isi_sdk_8_1_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/isi_sdk_8_1_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/isi_sdk_8_1_0/models/compatibilities_class_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_1_0.models.compati... | 28.252174 | 129 | 0.590643 |
import pprint
import re
import six
from isi_sdk_8_1_0.models.compatibilities_class_active_active_item import CompatibilitiesClassActiveActiveItem
class CompatibilitiesClassActive(object):
swagger_types = {
'active': 'list[CompatibilitiesClassActiveActiveItem]'
}
attribute_map = {
... | true | true |
f76b549daa45231c8c519b13d6ab13446a8ad16e | 2,224 | py | Python | setup.py | jim22k/python-suitesparse-graphblas | 09eb560950dd848cadef6115c78ef4ed2e1ae80f | [
"Apache-2.0"
] | null | null | null | setup.py | jim22k/python-suitesparse-graphblas | 09eb560950dd848cadef6115c78ef4ed2e1ae80f | [
"Apache-2.0"
] | null | null | null | setup.py | jim22k/python-suitesparse-graphblas | 09eb560950dd848cadef6115c78ef4ed2e1ae80f | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages, Extension
from glob import glob
try:
from Cython.Build import cythonize
from Cython.Compiler.Options import get_directive_defaults
use_cython = True
except ImportError:
use_cython = False
import numpy as np
import os
import sys
import versioneer
define_mac... | 31.771429 | 80 | 0.704586 | from setuptools import setup, find_packages, Extension
from glob import glob
try:
from Cython.Build import cythonize
from Cython.Compiler.Options import get_directive_defaults
use_cython = True
except ImportError:
use_cython = False
import numpy as np
import os
import sys
import versioneer
define_mac... | true | true |
f76b549eb04282bd38a2ef02dc0b063e134f9fe8 | 7,016 | py | Python | enso/providers.py | toolness/community-enso | e688e14628765235bf3575401192fc66f4c57236 | [
"BSD-3-Clause"
] | 2 | 2015-12-02T16:54:36.000Z | 2018-02-04T00:41:39.000Z | enso/providers.py | toolness/community-enso | e688e14628765235bf3575401192fc66f4c57236 | [
"BSD-3-Clause"
] | null | null | null | enso/providers.py | toolness/community-enso | e688e14628765235bf3575401192fc66f4c57236 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 41.02924 | 79 | 0.616876 |
import logging
import enso.config
_interfaces = {}
_providers = []
def _initDefaultProviders():
for moduleName in enso.config.PROVIDERS:
try:
module = __import__( moduleName, {}, {}, [] )
components = moduleName.split( "." )
for compon... | true | true |
f76b579a54505a3fa6904733407a5cf3b352a8e4 | 665 | py | Python | agsadmin/rest_admin/services/GpServer.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 2 | 2015-12-07T05:53:29.000Z | 2020-09-13T18:12:15.000Z | agsadmin/rest_admin/services/GpServer.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 4 | 2015-03-09T05:59:14.000Z | 2018-01-09T00:12:56.000Z | agsadmin/rest_admin/services/GpServer.py | christopherblanchfield/agsadmin | 989cb3795aacf285ccf74ee51b0de26bf2f48bc3 | [
"BSD-3-Clause"
] | 5 | 2015-03-09T01:05:24.000Z | 2019-09-09T23:01:21.000Z | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from .Service import Service
_SERVICE_TYPE = "GPServer"
class GpServer(Service):... | 39.117647 | 117 | 0.724812 | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from .Service import Service
_SERVICE_TYPE = "GPServer"
class GpServer(Service):... | true | true |
f76b580d01b76f8b9d8a003478cd2c728ac06438 | 3,631 | py | Python | lib/dmcomm/protocol/core16.py | dmcomm/dmcomm-python | 7f3788237ad8934de874ddda8f31c7449d5fc2dd | [
"MIT"
] | 1 | 2022-01-02T07:57:38.000Z | 2022-01-02T07:57:38.000Z | lib/dmcomm/protocol/core16.py | dmcomm/dmcomm-python | 7f3788237ad8934de874ddda8f31c7449d5fc2dd | [
"MIT"
] | null | null | null | lib/dmcomm/protocol/core16.py | dmcomm/dmcomm-python | 7f3788237ad8934de874ddda8f31c7449d5fc2dd | [
"MIT"
] | null | null | null | # This file is part of the DMComm project by BladeSabre. License: MIT.
"""
`dmcomm.protocol.core16`
========================
Handling of 16-bit low-level protocols.
Note: This API is still under development and may change at any time.
"""
from dmcomm import CommandError
from dmcomm.protocol import Result
class Dig... | 29.282258 | 100 | 0.692922 |
from dmcomm import CommandError
from dmcomm.protocol import Result
class DigiROM:
def __init__(self, physical, turn, segments=[]):
self.physical = physical
self.turn = turn
self._segments = segments
self.result = None
def append(self, c):
self._segments.append(c)
def prepare(self):
self.result = Resul... | true | true |
f76b5888d6946983527f9ef97fda77431dfd9504 | 3,663 | py | Python | aiida/storage/psql_dos/migrations/versions/django_0024a_dblog_update.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 153 | 2016-12-23T20:59:03.000Z | 2019-07-02T06:47:52.000Z | aiida/storage/psql_dos/migrations/versions/django_0024a_dblog_update.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 2,466 | 2016-12-24T01:03:52.000Z | 2019-07-04T13:41:08.000Z | aiida/storage/psql_dos/migrations/versions/django_0024a_dblog_update.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 88 | 2016-12-23T16:28:00.000Z | 2019-07-01T15:55:20.000Z | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39.387097 | 119 | 0.652471 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from aiida.storage.psql_dos.migrations.utils.dblog_update import export_and_clean_workflow_logs, set_new_uuid
revision = 'django_0024a'
down_revision = 'django_0023'
branch_labels = None
depends_on = None
def upgrade():
co... | true | true |
f76b589d85f90042f605e737b2b4016bb3ba644b | 6,665 | py | Python | scripts/devstack_sanity_tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | scripts/devstack_sanity_tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | scripts/devstack_sanity_tests_with_setup.py | rombie/contrail-test | a68c71d6f282142501a7e2e889bbb232fdd82dc3 | [
"Apache-2.0"
] | null | null | null | # Need to import path to test/fixtures and test/scripts/
# Ex : export PYTHONPATH='$PATH:/root/test/fixtures/:/root/test/scripts/'
#
# To run tests, you can do 'python sanity_tests.py'. To run specific tests,
# You can do 'python -m testtools.run -l tests'
# Set the env variable PARAMS_FILE to point to your ini file. E... | 45.650685 | 105 | 0.773743 | import os
import time
import unittest
from tests import TestSanityFixture
from tests_with_setup import *
from encap_tests import *
from mx_test import *
from test_perms import *
from util import get_os_env
from NewPolicyTests import *
from policyTrafficTests import *
from sdn_policy_traffic_test_topo import *
from Par... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.