hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
237cf432cb2a9b8f4203ddc700aff3c83f06d064 | 1,302 | py | Python | deploy/run.py | dato-code/Strata-Now | 995ed8851275996ea82131bf6e3d05131c620f60 | [
"BSD-3-Clause"
] | 4 | 2015-05-05T16:05:35.000Z | 2016-05-19T21:02:25.000Z | deploy/run.py | turi-code/Strata-Now | 995ed8851275996ea82131bf6e3d05131c620f60 | [
"BSD-3-Clause"
] | 1 | 2015-10-07T18:59:39.000Z | 2015-10-07T18:59:39.000Z | deploy/run.py | dato-code/Strata-Now | 995ed8851275996ea82131bf6e3d05131c620f60 | [
"BSD-3-Clause"
] | 6 | 2015-05-05T02:11:07.000Z | 2016-05-16T19:24:22.000Z | import graphlab as gl
from models import *
path = "s3://gl-demo-usw2/predictive_service/demolab/ps-1.6"
ps = gl.deploy.predictive_service.load(path)
# Define dependencies
state = {'details_filename': '../data/talks.json',
'speakers_filename': '../data/speakers.json',
'details_sf': '../data/talks.g... | 33.384615 | 191 | 0.704301 | import graphlab as gl
from models import *
path = "s3://gl-demo-usw2/predictive_service/demolab/ps-1.6"
ps = gl.deploy.predictive_service.load(path)
# Define dependencies
state = {'details_filename': '../data/talks.json',
'speakers_filename': '../data/speakers.json',
'details_sf': '../data/talks.g... | 0 | 0 | 0 |
602796473f89d9acc225140c9078f5ec9c51d423 | 7,892 | py | Python | fuzzylogic.py | bydzen/fuzzy-logic-sc | ccbff1a34bb19048f540244aafd38197cc12318d | [
"MIT"
] | 1 | 2021-08-22T13:52:52.000Z | 2021-08-22T13:52:52.000Z | fuzzylogic.py | bydzen/fuzzy-logic-sc | ccbff1a34bb19048f540244aafd38197cc12318d | [
"MIT"
] | null | null | null | fuzzylogic.py | bydzen/fuzzy-logic-sc | ccbff1a34bb19048f540244aafd38197cc12318d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xlwt
#!gdown --id 1bb2irg5nFZhoFkpjWPQHJPBBr8FiK8l7
dataRestoran = pd.read_excel('restoran.xlsx')
print(dataRestoran)
# akan menghasilkan nilai kelayakan yang lebih bervariasi
titikPelayanan = [25, 37, 58, 65, 78, 8... | 30.94902 | 86 | 0.593512 | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xlwt
#!gdown --id 1bb2irg5nFZhoFkpjWPQHJPBBr8FiK8l7
dataRestoran = pd.read_excel('restoran.xlsx')
print(dataRestoran)
# akan menghasilkan nilai kelayakan yang lebih bervariasi
titikPelayanan = [25, 37, 58, 65, 78, 8... | 5,765 | 0 | 230 |
deb1cc2b3769ab3932370a34f4aedc4d58995c77 | 866 | py | Python | src/circuitsascode/__init__.py | devbisme/circuitsascode | 497ac4650b0da8d65f4b22eceefe918b66f915b4 | [
"MIT"
] | 3 | 2021-08-28T15:02:53.000Z | 2022-01-17T21:43:31.000Z | src/circuitsascode/__init__.py | devbisme/circuitsascode | 497ac4650b0da8d65f4b22eceefe918b66f915b4 | [
"MIT"
] | null | null | null | src/circuitsascode/__init__.py | devbisme/circuitsascode | 497ac4650b0da8d65f4b22eceefe918b66f915b4 | [
"MIT"
] | null | null | null | # The MIT License (MIT) - Copyright (c) 2021 xesscorp
"""
Categorized collections of circuits.
"""
import sys
import pint
# Create a shortcut name for "circuitsascode".
sys.modules["casc"] = sys.modules["circuitsascode"]
# For electrical units like ohms, volts, etc.
units = pint.UnitRegistry()
if sys.version_info... | 27.935484 | 85 | 0.732102 | # The MIT License (MIT) - Copyright (c) 2021 xesscorp
"""
Categorized collections of circuits.
"""
import sys
import pint
# Create a shortcut name for "circuitsascode".
sys.modules["casc"] = sys.modules["circuitsascode"]
# For electrical units like ohms, volts, etc.
units = pint.UnitRegistry()
if sys.version_info... | 0 | 0 | 0 |
59e413e90db4fea7b7d53b3bfbe74dbdf3fef42a | 8,095 | py | Python | electrical_simulation/versuch_versuch.py | architecture-building-systems/bipv-tool | 3ae73a541754e5215dfd39ef837d72f4b80ef967 | [
"MIT"
] | 4 | 2019-02-18T14:10:49.000Z | 2021-04-23T09:03:13.000Z | electrical_simulation/versuch_versuch.py | architecture-building-systems/bipv-tool | 3ae73a541754e5215dfd39ef837d72f4b80ef967 | [
"MIT"
] | 1 | 2018-08-16T13:27:15.000Z | 2018-08-16T13:27:16.000Z | electrical_simulation/versuch_versuch.py | architecture-building-systems/bipv-tool | 3ae73a541754e5215dfd39ef837d72f4b80ef967 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import json
import datetime
import miasole_module_two as ps
import pvlib.pvsystem as pvsyst
#import shaded_miasole as ps
import interconnection as connect
import matplotlib.pyplot as plt
def align_yaxis(ax1, v1, ax2, v2):
"""adjust ax2 ylimit so that v2 in ax2 is aligned to... | 43.994565 | 152 | 0.664484 | import pandas as pd
import numpy as np
import json
import datetime
import miasole_module_two as ps
import pvlib.pvsystem as pvsyst
#import shaded_miasole as ps
import interconnection as connect
import matplotlib.pyplot as plt
def get_irradiation_value(path, time, sensor_name):
time = time.replace(second=0)
ir... | 2,901 | 0 | 160 |
d49cc9d9d750d1b39deda00590557e916ce04222 | 1,231 | py | Python | venv/lib/python3.6/site-packages/zmq/sugar/version.py | paxthree/life-dashboard | 8c65857d1102331b1e913d8800c61af1f61d9532 | [
"CC0-1.0"
] | null | null | null | venv/lib/python3.6/site-packages/zmq/sugar/version.py | paxthree/life-dashboard | 8c65857d1102331b1e913d8800c61af1f61d9532 | [
"CC0-1.0"
] | 19 | 2020-01-28T21:41:50.000Z | 2022-03-11T23:17:39.000Z | thunau/lib/python3.6/site-packages/zmq/sugar/version.py | karlburkhart/thunau | 900dca0259b30a229cd84f6315a7da9be94cb355 | [
"MIT"
] | 1 | 2018-09-19T05:55:27.000Z | 2018-09-19T05:55:27.000Z | """PyZMQ and 0MQ version functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.backend import zmq_version_info
VERSION_MAJOR = 16
VERSION_MINOR = 0
VERSION_PATCH = 4
VERSION_EXTRA = ""
__version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PAT... | 25.122449 | 86 | 0.692933 | """PyZMQ and 0MQ version functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.backend import zmq_version_info
VERSION_MAJOR = 16
VERSION_MINOR = 0
VERSION_PATCH = 4
VERSION_EXTRA = ""
__version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PAT... | 0 | 0 | 0 |
4300d28866dc3941f3120411372fade12a422e39 | 3,846 | py | Python | penguin_random_house/parse_scripts/books.py | EvgenyTsydenov/book_recommender | bfbbed52907f979a6ba404f9d1f2ff8cfe142aff | [
"MIT"
] | null | null | null | penguin_random_house/parse_scripts/books.py | EvgenyTsydenov/book_recommender | bfbbed52907f979a6ba404f9d1f2ff8cfe142aff | [
"MIT"
] | null | null | null | penguin_random_house/parse_scripts/books.py | EvgenyTsydenov/book_recommender | bfbbed52907f979a6ba404f9d1f2ff8cfe142aff | [
"MIT"
] | null | null | null | import json
import os
from tqdm import tqdm
def parse_book(book_data: dict) -> dict:
"""Parse book core data."""
info = {}
for param in ['isbn', 'title', 'onsale', 'price',
'language', 'pages', 'publisher']:
info[param] = book_data.get(param)
info['cover'] = f'https://images... | 32.05 | 75 | 0.568903 | import json
import os
from tqdm import tqdm
def parse_book(book_data: dict) -> dict:
"""Parse book core data."""
info = {}
for param in ['isbn', 'title', 'onsale', 'price',
'language', 'pages', 'publisher']:
info[param] = book_data.get(param)
info['cover'] = f'https://images... | 0 | 0 | 0 |
b7d7274c982532facf17dec2970f658f11cf429a | 3,502 | py | Python | scripts/parse_proto.py | JustinGanzer/j2objc | feb43475d70a027c96d5e94874003ef65e6ae34b | [
"Apache-2.0"
] | null | null | null | scripts/parse_proto.py | JustinGanzer/j2objc | feb43475d70a027c96d5e94874003ef65e6ae34b | [
"Apache-2.0"
] | null | null | null | scripts/parse_proto.py | JustinGanzer/j2objc | feb43475d70a027c96d5e94874003ef65e6ae34b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | 25.75 | 78 | 0.658195 | #!/usr/bin/python3
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | 2,303 | 0 | 163 |
859f22430c4589c36e57592748a354e17b82f62b | 33,061 | py | Python | tests/test_factors.py | mscarey/AuthoritySpoke | 047c30a5f8af8dcfae6d6cd4ec6d80bf646ff33b | [
"FTL",
"CNRI-Python",
"Apache-1.1"
] | 18 | 2019-05-13T23:04:48.000Z | 2022-03-23T00:48:30.000Z | tests/test_factors.py | mscarey/AuthoritySpoke | 047c30a5f8af8dcfae6d6cd4ec6d80bf646ff33b | [
"FTL",
"CNRI-Python",
"Apache-1.1"
] | 98 | 2019-05-07T10:38:03.000Z | 2021-10-17T01:54:27.000Z | tests/test_factors.py | mscarey/AuthoritySpoke | 047c30a5f8af8dcfae6d6cd4ec6d80bf646ff33b | [
"FTL",
"CNRI-Python",
"Apache-1.1"
] | 1 | 2020-06-15T17:31:57.000Z | 2020-06-15T17:31:57.000Z | import operator
import pytest
from nettlesome.terms import ContextRegister, DuplicateTermError
from nettlesome.terms import Explanation, TermSequence, means
from nettlesome.entities import Entity
from nettlesome.groups import FactorGroup
from nettlesome.predicates import Predicate
from nettlesome.quantities import Co... | 42.169643 | 91 | 0.669641 | import operator
import pytest
from nettlesome.terms import ContextRegister, DuplicateTermError
from nettlesome.terms import Explanation, TermSequence, means
from nettlesome.entities import Entity
from nettlesome.groups import FactorGroup
from nettlesome.predicates import Predicate
from nettlesome.quantities import Co... | 21,389 | 11,064 | 218 |
74d5c07e6a219370de5020bdd900eea843a2ba4f | 165,553 | py | Python | icbd/compiler/compiler_types.py | kmod/icbd | 9636564eb3993afa07c6220d589bbd1991923d74 | [
"MIT"
] | 7 | 2015-04-06T15:17:13.000Z | 2020-10-21T04:57:00.000Z | icbd/compiler/compiler_types.py | kmod/icbd | 9636564eb3993afa07c6220d589bbd1991923d74 | [
"MIT"
] | null | null | null | icbd/compiler/compiler_types.py | kmod/icbd | 9636564eb3993afa07c6220d589bbd1991923d74 | [
"MIT"
] | 4 | 2016-05-16T17:53:08.000Z | 2020-11-28T17:18:50.000Z | import _ast
import inspect
import re
import sys
import traceback
from . import closure_analyzer
from .code_emitter import CodeEmitter
DEBUG_CHECKS = True
BINOP_MAP = {
_ast.Add:"__add__",
_ast.Sub:"__sub__",
_ast.Mult:"__mul__",
_ast.BitOr:"__or__",
_ast.BitXor:"__xor__",
... | 41.669519 | 331 | 0.570228 | import _ast
import inspect
import re
import sys
import traceback
from . import closure_analyzer
from .code_emitter import CodeEmitter
DEBUG_CHECKS = True
BINOP_MAP = {
_ast.Add:"__add__",
_ast.Sub:"__sub__",
_ast.Mult:"__mul__",
_ast.BitOr:"__or__",
_ast.BitXor:"__xor__",
... | 143,686 | 8,264 | 3,719 |
cb9d202d11aad5d50b66f4a9f03ebef480d92465 | 435 | py | Python | app/models/item.py | yudjinn/backend-starlite-postgres | 2cb42a9f85f902e2bdfb6cb99d306401e6b23e7f | [
"MIT"
] | null | null | null | app/models/item.py | yudjinn/backend-starlite-postgres | 2cb42a9f85f902e2bdfb6cb99d306401e6b23e7f | [
"MIT"
] | null | null | null | app/models/item.py | yudjinn/backend-starlite-postgres | 2cb42a9f85f902e2bdfb6cb99d306401e6b23e7f | [
"MIT"
] | 2 | 2022-02-06T17:29:15.000Z | 2022-03-04T12:46:39.000Z | import uuid
from sqlalchemy import Column, ForeignKey, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from .base import Base
from .mixins import DateFieldsMixins
| 27.1875 | 75 | 0.770115 | import uuid
from sqlalchemy import Column, ForeignKey, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from .base import Base
from .mixins import DateFieldsMixins
class Item(DateFieldsMixins, Base):
name: str = Column(String(64), nullable=False)
owner_id: uuid.... | 0 | 199 | 23 |
1df90d6b5a21d880a74025dd9aa1c5f1ebfced00 | 7,715 | py | Python | addons/io_scene_gltf2/io/exp/gltf2_io_get.py | dtysky/glTF-Blender-IO | 5488adce3d496c6db7b2fff121d4fb46962a02b2 | [
"Apache-2.0"
] | null | null | null | addons/io_scene_gltf2/io/exp/gltf2_io_get.py | dtysky/glTF-Blender-IO | 5488adce3d496c6db7b2fff121d4fb46962a02b2 | [
"Apache-2.0"
] | null | null | null | addons/io_scene_gltf2/io/exp/gltf2_io_get.py | dtysky/glTF-Blender-IO | 5488adce3d496c6db7b2fff121d4fb46962a02b2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 20.091146 | 114 | 0.6 | # Copyright (c) 2017 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 0 | 0 | 0 |
527d5a647225fe1451d9322370f1d08e468c34af | 696 | py | Python | Src/Web/config.py | 23233/sproxy | b40d6593e3a60ba089484c527de1bc4afc3a2d24 | [
"MIT"
] | 167 | 2019-07-05T13:25:39.000Z | 2020-04-25T11:31:19.000Z | Src/Web/config.py | 23233/sproxy | b40d6593e3a60ba089484c527de1bc4afc3a2d24 | [
"MIT"
] | 10 | 2018-12-11T06:07:37.000Z | 2019-07-03T11:14:36.000Z | Src/Web/config.py | 23233/sproxy | b40d6593e3a60ba089484c527de1bc4afc3a2d24 | [
"MIT"
] | 38 | 2019-07-04T07:50:08.000Z | 2020-04-17T21:05:46.000Z | # Create dummy secrey key so we can use sessions
SECRET_KEY = '1234567890'
# Flask-Security config
SECURITY_URL_PREFIX = "/admin"
SECURITY_PASSWORD_HASH = "pbkdf2_sha256"
SECURITY_PASSWORD_SALT = "ATGUOHAELKiubahiughaerGOJAEGj"
SECURITY_USER_IDENTITY_ATTRIBUTES = ["name"]
# Flask-Security URLs, overridden because th... | 30.26087 | 71 | 0.804598 | # Create dummy secrey key so we can use sessions
SECRET_KEY = '1234567890'
# Flask-Security config
SECURITY_URL_PREFIX = "/admin"
SECURITY_PASSWORD_HASH = "pbkdf2_sha256"
SECURITY_PASSWORD_SALT = "ATGUOHAELKiubahiughaerGOJAEGj"
SECURITY_USER_IDENTITY_ATTRIBUTES = ["name"]
# Flask-Security URLs, overridden because th... | 0 | 0 | 0 |
813d0a9cf8930b06ac9932bbfc5b272617c5c4ac | 3,785 | py | Python | homeassistant/components/mobile_app/websocket_api.py | jeanfpoulin/home-assistant | 04dbe5bc841e1a429873efbd850c35b823ef26ce | [
"Apache-2.0"
] | 3 | 2020-05-18T10:18:16.000Z | 2020-12-08T11:27:55.000Z | homeassistant/components/mobile_app/websocket_api.py | jeanfpoulin/home-assistant | 04dbe5bc841e1a429873efbd850c35b823ef26ce | [
"Apache-2.0"
] | 3 | 2021-02-08T20:54:46.000Z | 2021-09-08T02:30:04.000Z | homeassistant/components/mobile_app/websocket_api.py | jeanfpoulin/home-assistant | 04dbe5bc841e1a429873efbd850c35b823ef26ce | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Websocket API for mobile_app."""
import voluptuous as vol
from homeassistant.components.cloud import async_delete_cloudhook
from homeassistant.components.websocket_api import (
ActiveConnection,
async_register_command,
async_response,
error_message,
result_message,
websocket_command,
ws_... | 30.772358 | 88 | 0.732893 | """Websocket API for mobile_app."""
import voluptuous as vol
from homeassistant.components.cloud import async_delete_cloudhook
from homeassistant.components.websocket_api import (
ActiveConnection,
async_register_command,
async_response,
error_message,
result_message,
websocket_command,
ws_... | 0 | 0 | 0 |
fba6df107748d61010973df91014413655aef5fb | 4,000 | py | Python | test_locks.py | zbentley/amqp-locks-python | 7da8e941fff752bde1f1fd56caa51810fdac7577 | [
"MIT"
] | null | null | null | test_locks.py | zbentley/amqp-locks-python | 7da8e941fff752bde1f1fd56caa51810fdac7577 | [
"MIT"
] | null | null | null | test_locks.py | zbentley/amqp-locks-python | 7da8e941fff752bde1f1fd56caa51810fdac7577 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pika
import time
import sys
import argparse
sys.path.append("lib")
from rabbitlock.mutex import Mutex
from rabbitlock.semaphore import Semaphore
# http://www.huyng.com/posts/python-performance-analysis/
parse_and_dispatch(sys.argv[1:])
| 29.411765 | 101 | 0.62375 | #!/usr/bin/env python3
import pika
import time
import sys
import argparse
sys.path.append("lib")
from rabbitlock.mutex import Mutex
from rabbitlock.semaphore import Semaphore
def positive_float(value):
retval = float(value)
if retval < 0:
raise argparse.ArgumentTypeError("%s not a positive float" % ... | 3,483 | -1 | 240 |
5b3f69f42eae7163ac1ea43116b8a85cdb9c27b7 | 1,068 | py | Python | django_sourcebook/sourcebook/migrations/0009_auto_20200101_2140.py | maxblee/django_sourcebook | f90ca62cfe43c875a485f783ca1a06be40d9bbc5 | [
"MIT"
] | null | null | null | django_sourcebook/sourcebook/migrations/0009_auto_20200101_2140.py | maxblee/django_sourcebook | f90ca62cfe43c875a485f783ca1a06be40d9bbc5 | [
"MIT"
] | null | null | null | django_sourcebook/sourcebook/migrations/0009_auto_20200101_2140.py | maxblee/django_sourcebook | f90ca62cfe43c875a485f783ca1a06be40d9bbc5 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.1 on 2020-01-02 02:40
import datetime
from django.db import migrations, models
| 29.666667 | 78 | 0.495318 | # Generated by Django 3.0.1 on 2020-01-02 02:40
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("sourcebook", "0008_foiarequest_time_completed"),
]
operations = [
migrations.AddField(
model_name="story",
... | 0 | 938 | 23 |
0655f1c66e00a9e31b9d920ea6a88703dd4f5793 | 3,688 | py | Python | src/exp_num_query.py | moseslichten/TAFSSL | b236dee4936fe933293ebdd65e48a332a3aacdea | [
"Apache-2.0"
] | 10 | 2020-09-26T07:07:52.000Z | 2021-10-11T12:11:33.000Z | src/exp_num_query.py | moseslichten/TAFSSL | b236dee4936fe933293ebdd65e48a332a3aacdea | [
"Apache-2.0"
] | 1 | 2021-04-16T14:36:28.000Z | 2021-04-16T14:36:28.000Z | src/exp_num_query.py | moseslichten/TAFSSL | b236dee4936fe933293ebdd65e48a332a3aacdea | [
"Apache-2.0"
] | 2 | 2020-09-26T07:00:21.000Z | 2021-08-14T14:12:50.000Z | # --------------------------------------------------------
# TAFSSL
# Copyright (c) 2019 IBM Corp
# Licensed under The Apache-2.0 License [see LICENSE for details]
# --------------------------------------------------------
import numpy as np
from utils.proto_msp import ProtoMSP
import time
import pickle
from utils.mis... | 32.637168 | 116 | 0.608731 | # --------------------------------------------------------
# TAFSSL
# Copyright (c) 2019 IBM Corp
# Licensed under The Apache-2.0 License [see LICENSE for details]
# --------------------------------------------------------
import numpy as np
from utils.proto_msp import ProtoMSP
import time
import pickle
from utils.mis... | 2,929 | 0 | 92 |
0276265483623e630c7767433a7cadbaf7c7e997 | 25 | py | Python | src/scripts/__init__.py | arcosin/ANP_TrackDriver | d1705bb77959cb3653490e126a40f8086ba084bd | [
"MIT"
] | 4 | 2019-05-22T00:17:28.000Z | 2020-08-26T02:03:33.000Z | preprocess/__init__.py | ryanwongsa/open-images-2019-challenge | b49e0933451c4bf9b31a9a8faf1bd8ba3dee1cc5 | [
"Apache-2.0"
] | 3 | 2019-07-14T09:17:11.000Z | 2022-01-13T01:15:10.000Z | preprocess/__init__.py | ryanwongsa/open-images-2019-challenge | b49e0933451c4bf9b31a9a8faf1bd8ba3dee1cc5 | [
"Apache-2.0"
] | 5 | 2021-03-24T01:02:06.000Z | 2021-05-21T16:57:05.000Z | from .preprocess import * | 25 | 25 | 0.8 | from .preprocess import * | 0 | 0 | 0 |
5e9233f492e89e51840f8454bc6abde3f18cbc0a | 3,259 | py | Python | qcommunity/optimization/obj.py | rsln-s/QCommunity | 926c64efc7add34dae5fbab20359ef5b9b4aa420 | [
"Apache-2.0"
] | 2 | 2019-09-05T23:21:49.000Z | 2020-03-10T13:54:32.000Z | qcommunity/optimization/obj.py | rsln-s/QCommunity | 926c64efc7add34dae5fbab20359ef5b9b4aa420 | [
"Apache-2.0"
] | null | null | null | qcommunity/optimization/obj.py | rsln-s/QCommunity | 926c64efc7add34dae5fbab20359ef5b9b4aa420 | [
"Apache-2.0"
] | 1 | 2020-03-10T13:54:34.000Z | 2020-03-10T13:54:34.000Z | #!/usr/bin/env python
# Returns obj_val function to be used in an optimizer
# A better and updated version of qaoa_obj.py
import networkx as nx
import numpy as np
# import matplotlib.pyplot as plt
from networkx.generators.classic import barbell_graph
import copy
import sys
import warnings
import qcommunity.modularit... | 32.267327 | 166 | 0.59865 | #!/usr/bin/env python
# Returns obj_val function to be used in an optimizer
# A better and updated version of qaoa_obj.py
import networkx as nx
import numpy as np
# import matplotlib.pyplot as plt
from networkx.generators.classic import barbell_graph
import copy
import sys
import warnings
import qcommunity.modularit... | 1,063 | 0 | 58 |
5d32eec903f269edde168438b4d81ba0b9cc8d71 | 1,274 | py | Python | tests/test_write.py | reshalfahsi/GGBColorSpace | f56994ffcd6a83762d67705116e690c7a64c9093 | [
"MIT"
] | 1 | 2020-12-06T07:38:08.000Z | 2020-12-06T07:38:08.000Z | tests/test_write.py | reshalfahsi/GGBColorSpace | f56994ffcd6a83762d67705116e690c7a64c9093 | [
"MIT"
] | 1 | 2021-06-19T02:20:02.000Z | 2021-06-19T02:20:02.000Z | tests/test_write.py | reshalfahsi/GGB | f56994ffcd6a83762d67705116e690c7a64c9093 | [
"MIT"
] | 1 | 2021-05-10T04:14:24.000Z | 2021-05-10T04:14:24.000Z | import cv2
from PIL import Image
import numpy as np
import random
import pytest
from ggb import GGB, CVLib
from ggb.testing import ggb_test
from ggb.testing import get_random_image, get_filled_image
@ggb_test
@ggb_test
if __name__ == '__main__':
pytest.main([__file__])
| 25.48 | 58 | 0.689168 | import cv2
from PIL import Image
import numpy as np
import random
import pytest
from ggb import GGB, CVLib
from ggb.testing import ggb_test
from ggb.testing import get_random_image, get_filled_image
@ggb_test
def test_opencv_write():
w = random.randint(16, 2048)
h = random.randint(16, 2048)
image = get_r... | 949 | 0 | 44 |
092bdfd9880f8cd15ba0d55680a5b605d55352b5 | 9,518 | py | Python | tests/unit/test_marc_writer.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | null | null | null | tests/unit/test_marc_writer.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | 17 | 2020-12-07T04:43:48.000Z | 2022-03-30T12:44:41.000Z | tests/unit/test_marc_writer.py | BookOps-CAT/NightShift | dc106b55cee3ec60c790f71f20e0754506385d59 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests `marc.marc_writer.py` module
"""
from contextlib import nullcontext as does_not_raise
import logging
import os
import pickle
from pymarc import Field, MARCReader, Record
import pytest
from nightshift import __title__, __version__
from nightshift.datastore import Resource
from nights... | 35.251852 | 109 | 0.560937 | # -*- coding: utf-8 -*-
"""
Tests `marc.marc_writer.py` module
"""
from contextlib import nullcontext as does_not_raise
import logging
import os
import pickle
from pymarc import Field, MARCReader, Record
import pytest
from nightshift import __title__, __version__
from nightshift.datastore import Resource
from nights... | 7,247 | 1,886 | 23 |
db40eccb4e3a9805eb8362b1213257f77b448646 | 590 | py | Python | schedule/migrations/0014_event_status.py | itmagistr/django-scheduler | 14d403b581d6ec5c195f7cd4f1567f6f636d1efb | [
"BSD-3-Clause"
] | null | null | null | schedule/migrations/0014_event_status.py | itmagistr/django-scheduler | 14d403b581d6ec5c195f7cd4f1567f6f636d1efb | [
"BSD-3-Clause"
] | null | null | null | schedule/migrations/0014_event_status.py | itmagistr/django-scheduler | 14d403b581d6ec5c195f7cd4f1567f6f636d1efb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-02 18:17
from __future__ import unicode_literals
from django.db import migrations, models
| 28.095238 | 190 | 0.640678 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-02 18:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0013_auto_20180424_1145'),
]
operations = [
migrations.AddFiel... | 0 | 410 | 23 |
5f18738c3a2c1e5ce066a636d50938a7b409ce4a | 939 | py | Python | test/wien2k/w2kutils_test.py | minyez/mykit | 911413120c081be2cfcaef06d62dc40b2abd2747 | [
"MIT"
] | 4 | 2019-01-02T09:17:54.000Z | 2019-12-26T07:15:59.000Z | test/wien2k/w2kutils_test.py | minyez/mykit | 911413120c081be2cfcaef06d62dc40b2abd2747 | [
"MIT"
] | 6 | 2019-03-06T03:16:12.000Z | 2019-03-14T14:36:01.000Z | test/wien2k/w2kutils_test.py | minyez/mykit | 911413120c081be2cfcaef06d62dc40b2abd2747 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding = utf-8
import os
import unittest as ut
from mykit.wien2k.utils import get_casename, find_complex_file, get_default_r0, get_default_rmt, get_z
if __name__ == '__main__':
ut.main() | 27.617647 | 102 | 0.683706 | #!/usr/bin/env python3
# coding = utf-8
import os
import unittest as ut
from mykit.wien2k.utils import get_casename, find_complex_file, get_default_r0, get_default_rmt, get_z
class test_get_elements_info(ut.TestCase):
def test_r0(self):
self.assertEqual(get_default_r0('Ne1'), get_default_r0('Ne10'))
... | 525 | 36 | 158 |
646ad04a6e28b43086a847390064d260e25ae021 | 849 | py | Python | tests/test_nbp_api.py | woj-i/degiro-p | d6905b240fa558ba4affe835da7274272fe38dcf | [
"MIT"
] | 5 | 2021-02-21T08:16:15.000Z | 2021-05-26T14:14:10.000Z | tests/test_nbp_api.py | woj-i/degiro-pit | d6905b240fa558ba4affe835da7274272fe38dcf | [
"MIT"
] | null | null | null | tests/test_nbp_api.py | woj-i/degiro-pit | d6905b240fa558ba4affe835da7274272fe38dcf | [
"MIT"
] | null | null | null | from unittest import TestCase
from degiro_pit.config import Currency
from degiro_pit.nbp_api import NbpApi
| 28.3 | 61 | 0.664311 | from unittest import TestCase
from degiro_pit.config import Currency
from degiro_pit.nbp_api import NbpApi
class TestNbpApi(TestCase):
test_date = "2021-01-22"
def test_get_eur_pln(self):
nbp = NbpApi()
res = nbp.get_pln(TestNbpApi.test_date, Currency.EUR)
self.assertEqual(4.5354, re... | 574 | 143 | 23 |
6e87c4e4158b3902ea8dc3803de751b0eaa24e67 | 11,586 | py | Python | annotate/annotation/tasks.py | dojo-modeling/dojo | 8abc71790cbb8639a56c89791535b3df59c725ac | [
"MIT"
] | 3 | 2022-01-28T01:43:30.000Z | 2022-02-24T21:42:13.000Z | annotate/annotation/tasks.py | dojo-modeling/dojo | 8abc71790cbb8639a56c89791535b3df59c725ac | [
"MIT"
] | 8 | 2022-01-12T16:39:57.000Z | 2022-01-31T19:05:45.000Z | annotate/annotation/tasks.py | dojo-modeling/dojo | 8abc71790cbb8639a56c89791535b3df59c725ac | [
"MIT"
] | null | null | null | import copy
import json
import logging
import os
import time
from .rename import rename as rename_function
from django.apps import apps
from django.conf import settings
from django_rq import job
from mixmasta import mixmasta as mix
from utils.cache_helper import cache_get
# Load GADM3 from gadm app
if settings.CACHE... | 33.102857 | 175 | 0.566718 | import copy
import json
import logging
import os
import time
from .rename import rename as rename_function
from django.apps import apps
from django.conf import settings
from django_rq import job
from mixmasta import mixmasta as mix
from utils.cache_helper import cache_get
# Load GADM3 from gadm app
if settings.CACHE... | 5,599 | 0 | 114 |
90a6a38783bd1c23407224dbe76204ca852dc6a5 | 59 | py | Python | _Sensation0/__init__.py | Geson-anko/JARVIS3 | bc599a352401a7e135ebaabead4d8e6d8835747e | [
"MIT"
] | null | null | null | _Sensation0/__init__.py | Geson-anko/JARVIS3 | bc599a352401a7e135ebaabead4d8e6d8835747e | [
"MIT"
] | null | null | null | _Sensation0/__init__.py | Geson-anko/JARVIS3 | bc599a352401a7e135ebaabead4d8e6d8835747e | [
"MIT"
] | null | null | null | from .sensation import Sensation
from .train import Train
| 19.666667 | 32 | 0.813559 | from .sensation import Sensation
from .train import Train
| 0 | 0 | 0 |
c590a9496079ddf0947998d4b4dfc4b5a7470b6f | 17,967 | py | Python | trec2014/python/cuttsum/pipeline/representation.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | 6 | 2015-09-10T02:22:21.000Z | 2021-10-01T16:36:46.000Z | trec2014/python/cuttsum/pipeline/representation.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | null | null | null | trec2014/python/cuttsum/pipeline/representation.py | kedz/cuttsum | 992c21192af03fd2ef863f5ab7d10752f75580fa | [
"Apache-2.0"
] | 2 | 2018-04-04T10:44:32.000Z | 2021-10-01T16:37:26.000Z | import marisa_trie
import os
import gzip
from collections import defaultdict
from nltk.tokenize import RegexpTokenizer
from cuttsum.srilm import Client
from itertools import izip
import string
from ..geo import GeoQuery
import numpy as np
import pandas as pd
from nltk.corpus import wordnet as wn
import re
... | 36.969136 | 79 | 0.554294 | import marisa_trie
import os
import gzip
from collections import defaultdict
from nltk.tokenize import RegexpTokenizer
from cuttsum.srilm import Client
from itertools import izip
import string
from ..geo import GeoQuery
import numpy as np
import pandas as pd
from nltk.corpus import wordnet as wn
import re
class Salien... | 16,656 | 75 | 907 |
f0ff86078deb2aa6845135b2c376566c8a81691f | 1,880 | py | Python | dags/utils/scale_features.py | tiendatscorpy/ETL-pipeline | e3f800596e17e0ac2b32f52ea06a196e477c3414 | [
"MIT"
] | null | null | null | dags/utils/scale_features.py | tiendatscorpy/ETL-pipeline | e3f800596e17e0ac2b32f52ea06a196e477c3414 | [
"MIT"
] | null | null | null | dags/utils/scale_features.py | tiendatscorpy/ETL-pipeline | e3f800596e17e0ac2b32f52ea06a196e477c3414 | [
"MIT"
] | null | null | null | import json
import os, errno
from typing import Dict
import numpy as np
import os
from sklearn.preprocessing import scale, minmax_scale
import logging
LOGGER = logging.getLogger(__name__)
def scale_features(input_folder: str, output_folder: str, op_conf: str, **kwargs):
"""
input_folder: folder which contain... | 35.471698 | 88 | 0.545745 | import json
import os, errno
from typing import Dict
import numpy as np
import os
from sklearn.preprocessing import scale, minmax_scale
import logging
LOGGER = logging.getLogger(__name__)
def scale_features(input_folder: str, output_folder: str, op_conf: str, **kwargs):
"""
input_folder: folder which contain... | 0 | 0 | 0 |
e54f3fcf098da3812b7d4a0e9f85780e8a12a31b | 934 | py | Python | benches/bench_merge.py | crkrenn/distogram | 9701233e46bd9e7528071c3c90600516d06c7f5a | [
"MIT"
] | 16 | 2020-07-12T17:27:46.000Z | 2022-03-22T23:42:24.000Z | benches/bench_merge.py | crkrenn/distogram | 9701233e46bd9e7528071c3c90600516d06c7f5a | [
"MIT"
] | 7 | 2020-06-20T01:43:34.000Z | 2022-02-02T17:41:36.000Z | benches/bench_merge.py | crkrenn/distogram | 9701233e46bd9e7528071c3c90600516d06c7f5a | [
"MIT"
] | 3 | 2020-12-27T07:36:48.000Z | 2021-11-04T18:56:46.000Z | import time
from functools import reduce
import distogram
import utils
if __name__ == '__main__':
bench_merge()
| 21.227273 | 56 | 0.591006 | import time
from functools import reduce
import distogram
import utils
def bench_merge():
num_samples = 10
num_points = 100_000
values_list = [
utils.create_values(mean, 0.3, num_points)
for mean in range(num_samples)
]
times_dict: utils.TimesDict = {num_points: dict()}
for ... | 791 | 0 | 23 |
094ba497e8b98cc0b00f380b8d7c8ff4348b9eb1 | 1,210 | py | Python | Chapter14/r2_paths_auth/my_library/models/sample_auth_http.py | a17juanbl/exercicios | 8df4bdf232207fcbc8f1308d1937ee599c1b39d4 | [
"MIT"
] | 125 | 2020-11-28T18:00:34.000Z | 2022-03-07T17:53:22.000Z | Chapter14/r2_paths_auth/my_library/models/sample_auth_http.py | a17juanbl/exercicios | 8df4bdf232207fcbc8f1308d1937ee599c1b39d4 | [
"MIT"
] | 5 | 2021-02-02T10:03:29.000Z | 2022-03-16T07:32:28.000Z | Chapter14/r2_paths_auth/my_library/models/sample_auth_http.py | a17juanbl/exercicios | 8df4bdf232207fcbc8f1308d1937ee599c1b39d4 | [
"MIT"
] | 182 | 2020-11-29T12:07:07.000Z | 2022-03-22T04:27:51.000Z | # -*- coding: utf-8 -*-
# /!\/!\/!\/!\/!\/!\/!\/!\
# Note that this is just a sample code
# You need to add this file in __init__.py
# /!\/!\/!\/!\/!\/!\/!\/!\
from odoo import exceptions, models
from odoo.http import request
| 28.139535 | 72 | 0.623967 | # -*- coding: utf-8 -*-
# /!\/!\/!\/!\/!\/!\/!\/!\
# Note that this is just a sample code
# You need to add this file in __init__.py
# /!\/!\/!\/!\/!\/!\/!\/!\
from odoo import exceptions, models
from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
@classmethod
def _a... | 440 | 518 | 23 |
6d5634d1807e48c38dd5968a7d8b0e5bd2f87b3d | 817 | py | Python | pypy/iterator_generator_coroutine/first_of_all/2_generator.py | DowsonJones/test_test | 9f941b20de42090e6ec9b449953ce1dae405ef73 | [
"MIT"
] | 1 | 2020-03-30T07:13:08.000Z | 2020-03-30T07:13:08.000Z | pypy/iterator_generator_coroutine/first_of_all/2_generator.py | DowsonJones/test_test | 9f941b20de42090e6ec9b449953ce1dae405ef73 | [
"MIT"
] | null | null | null | pypy/iterator_generator_coroutine/first_of_all/2_generator.py | DowsonJones/test_test | 9f941b20de42090e6ec9b449953ce1dae405ef73 | [
"MIT"
] | null | null | null |
F = fib(10) # 运行到这里没有任何反映
# print(next(F))
for i in F:
print(i)
"""
yield:
1. 保存运行状态-断点, 暂停执行将生成器挂起
2. 将yield后面表达式的值, 作为返回值返回
"""
# 使用yield实现协程
import time
if __name__ == '__main__':
main()
| 15.12963 | 42 | 0.49694 | def fib(n):
print('进入')
current = 0
num1, num2 = 0, 1
while current < n:
num = num1
num1, num2 = num2, num2 + num1
current += 1
yield num
return 'done'
F = fib(10) # 运行到这里没有任何反映
# print(next(F))
for i in F:
print(i)
"""
yield:
1. 保存运行状态-断点... | 493 | 0 | 98 |
5783c68228392e653ee096d49b29e66e2ac5a022 | 1,563 | py | Python | lib/opticalflow.py | hanebarla/CrowdCounting-using-PedestrianFlow | 0f7c196a8b396d92901172a334ecf0256f30ff8a | [
"MIT"
] | null | null | null | lib/opticalflow.py | hanebarla/CrowdCounting-using-PedestrianFlow | 0f7c196a8b396d92901172a334ecf0256f30ff8a | [
"MIT"
] | null | null | null | lib/opticalflow.py | hanebarla/CrowdCounting-using-PedestrianFlow | 0f7c196a8b396d92901172a334ecf0256f30ff8a | [
"MIT"
] | null | null | null | import os
import json
import cv2
import numpy as np
import matplotlib.pyplot as plt
import torch
if __name__ == "__main__":
# json file contains the test images
test_json_path = './test.json'
# the folder to output density map and flow maps
output_folder = './plot'
with open(test_json_path, 'r')... | 27.910714 | 86 | 0.632118 | import os
import json
import cv2
import numpy as np
import matplotlib.pyplot as plt
import torch
def OptFlow(c_prev_img, c_img):
prev_img = cv2.cvtColor(c_prev_img, cv2.COLOR_BGR2GRAY)
img = cv2.cvtColor(c_img, cv2.COLOR_BGR2GRAY)
hsv = np.zeros_like(c_img)
hsv[..., 1] = 255
flow = cv2.calcOptica... | 445 | 0 | 23 |
d367c19a7c2a7b23b387887269c0b45058aff294 | 6,978 | py | Python | fairseq/models/nat/old/latent/predictor_module.py | wangqi1996/cmlm | 78472e7edfecd8e36eaf5ae77c674033e1498735 | [
"MIT"
] | null | null | null | fairseq/models/nat/old/latent/predictor_module.py | wangqi1996/cmlm | 78472e7edfecd8e36eaf5ae77c674033e1498735 | [
"MIT"
] | null | null | null | fairseq/models/nat/old/latent/predictor_module.py | wangqi1996/cmlm | 78472e7edfecd8e36eaf5ae77c674033e1498735 | [
"MIT"
] | null | null | null | from torch import nn
from fairseq.modules import TransformerEncoderLayer, TransformerDecoderLayer
class Perceptron(nn.Module):
"""
1. 是否激活 通过是否有激活层来控制,最后一层都没有激活层
"""
class LogisticModel(nn.Module):
""" 两层感知机 """
def __init__(self, args, activation=None, dropout=0.1, contain_normalize=False, *... | 32.915094 | 120 | 0.633276 | from torch import nn
from fairseq.modules import TransformerEncoderLayer, TransformerDecoderLayer
def mean_ds(x, dim=None):
return (
x.float().mean().type_as(x)
if dim is None
else x.float().mean(dim).type_as(x)
)
class Perceptron(nn.Module):
"""
1. 是否激活 通过是否有激活层来控制,最后一层都没有激... | 4,602 | 1,193 | 432 |
5f0496938b0764b39076e5b64d229dd8946afff8 | 598 | py | Python | python-experiments/lambda_example.py | MichaelCurrin/python-2016 | 00af4e61175fc15aebfab208c76fe9db845d2f4c | [
"MIT"
] | null | null | null | python-experiments/lambda_example.py | MichaelCurrin/python-2016 | 00af4e61175fc15aebfab208c76fe9db845d2f4c | [
"MIT"
] | null | null | null | python-experiments/lambda_example.py | MichaelCurrin/python-2016 | 00af4e61175fc15aebfab208c76fe9db845d2f4c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" flatten a 2 dimensional list into a 1 dimension list
by joining column items in a row into one item as single comma-separated string
This is useful for preparing data for a CSV writer function which requires a 1-dimensional list of rows with no columns
Alternatively, the join functional can... | 27.181818 | 119 | 0.680602 | # -*- coding: utf-8 -*-
""" flatten a 2 dimensional list into a 1 dimension list
by joining column items in a row into one item as single comma-separated string
This is useful for preparing data for a CSV writer function which requires a 1-dimensional list of rows with no columns
Alternatively, the join functional can... | 0 | 0 | 0 |
afcd895d40b418f27e030dda81dde145aeb07ff0 | 49,651 | py | Python | src/NebulaBayes/tests/test_NB.py | ADThomas-astro/NebulaBayes | bda65809f43bc336914ce39ae59123e8be1abcbc | [
"MIT"
] | 2 | 2018-08-13T13:50:38.000Z | 2019-09-12T01:45:21.000Z | src/NebulaBayes/tests/test_NB.py | ADThomas-astro/NebulaBayes | bda65809f43bc336914ce39ae59123e8be1abcbc | [
"MIT"
] | null | null | null | src/NebulaBayes/tests/test_NB.py | ADThomas-astro/NebulaBayes | bda65809f43bc336914ce39ae59123e8be1abcbc | [
"MIT"
] | 1 | 2018-09-17T19:10:07.000Z | 2018-09-17T19:10:07.000Z | from __future__ import print_function, division
from collections import OrderedDict as OD
import itertools
import os
import unittest
from astropy.io import fits # FITS file I/O
from astropy.table import Table # Used in converting to pandas DataFrame
import numpy as np
import pandas as pd
import NebulaBayes
from Neb... | 44.65018 | 88 | 0.583372 | from __future__ import print_function, division
from collections import OrderedDict as OD
import itertools
import os
import unittest
from astropy.io import fits # FITS file I/O
from astropy.table import Table # Used in converting to pandas DataFrame
import numpy as np
import pandas as pd
import NebulaBayes
from Neb... | 17,028 | 99 | 838 |
7f5c849a1922a15d5a237861a7d432656ec07858 | 224 | py | Python | spider/spider/distance/rfd/__init__.py | Rosna/P4ML-UI | edf0dd830588f03b197e4d6532830a5aedd88424 | [
"Apache-2.0"
] | 1 | 2021-11-05T17:42:47.000Z | 2021-11-05T17:42:47.000Z | spider/spider/distance/rfd/__init__.py | Rosna/P4ML-UI | edf0dd830588f03b197e4d6532830a5aedd88424 | [
"Apache-2.0"
] | null | null | null | spider/spider/distance/rfd/__init__.py | Rosna/P4ML-UI | edf0dd830588f03b197e4d6532830a5aedd88424 | [
"Apache-2.0"
] | 2 | 2019-02-21T18:29:51.000Z | 2019-09-02T21:21:26.000Z | """
spider.distance.metricl.rfd sub-package
__init.py__
@author: david johnson
Primitive that learns and applies random-forest-based distance metric.
defines the module index
"""
from .rfd import RFD
| 17.230769 | 74 | 0.709821 | """
spider.distance.metricl.rfd sub-package
__init.py__
@author: david johnson
Primitive that learns and applies random-forest-based distance metric.
defines the module index
"""
from .rfd import RFD
| 0 | 0 | 0 |
e6cd940742010007d0946f002755532450bf69fa | 4,842 | py | Python | prission.py | mandypepe/pythontets | 5bf1d84e5c7c769b27c5cda221ab08cc6625daa4 | [
"Apache-2.0"
] | null | null | null | prission.py | mandypepe/pythontets | 5bf1d84e5c7c769b27c5cda221ab08cc6625daa4 | [
"Apache-2.0"
] | null | null | null | prission.py | mandypepe/pythontets | 5bf1d84e5c7c769b27c5cda221ab08cc6625daa4 | [
"Apache-2.0"
] | null | null | null | import pygame, sys
from pygame.locals import *
# Aclaraciones
# Requiere "pygame" para las graficas
#
# Se grafican las figuras para una mejor comprencion pero como son coordenadas tan pequenas no se muestran bien
# (aumentando las proporciones pude verse mejo)
# pero la orden del problema no lo permite.
#
... | 37.828125 | 117 | 0.522305 | import pygame, sys
from pygame.locals import *
# Aclaraciones
# Requiere "pygame" para las graficas
#
# Se grafican las figuras para una mejor comprencion pero como son coordenadas tan pequenas no se muestran bien
# (aumentando las proporciones pude verse mejo)
# pero la orden del problema no lo permite.
#
... | 777 | 0 | 35 |
1dc936213106f9d125c70a922c89b50eee90b068 | 4,148 | py | Python | scripts/mg-compare-heatmap.py | natalie-robinson/MG-RAST-Tools | ed28ffaeb17a156a1d249e4104b042a9ba9cb8d5 | [
"BSD-2-Clause"
] | 21 | 2015-01-18T01:43:12.000Z | 2021-09-09T03:26:59.000Z | scripts/mg-compare-heatmap.py | natalie-robinson/MG-RAST-Tools | ed28ffaeb17a156a1d249e4104b042a9ba9cb8d5 | [
"BSD-2-Clause"
] | 26 | 2015-01-22T21:23:09.000Z | 2021-11-13T17:55:37.000Z | scripts/mg-compare-heatmap.py | natalie-robinson/MG-RAST-Tools | ed28ffaeb17a156a1d249e4104b042a9ba9cb8d5 | [
"BSD-2-Clause"
] | 22 | 2015-01-18T01:44:36.000Z | 2021-09-18T09:29:06.000Z | #!/usr/bin/env python
import os
import sys
import json
from argparse import ArgumentParser
from mglib import obj_from_url, tab_to_matrix, AUTH_LIST, API_URL, biom_to_matrix, VERSION
prehelp = """
NAME
mg-compare-heatmap
VERSION
%s
SYNOPSIS
mg-compare-heatmap [ --help, --input <input file or stdin>, --ou... | 41.48 | 334 | 0.662729 | #!/usr/bin/env python
import os
import sys
import json
from argparse import ArgumentParser
from mglib import obj_from_url, tab_to_matrix, AUTH_LIST, API_URL, biom_to_matrix, VERSION
prehelp = """
NAME
mg-compare-heatmap
VERSION
%s
SYNOPSIS
mg-compare-heatmap [ --help, --input <input file or stdin>, --ou... | 2,855 | 0 | 23 |
3bf02f939d9fa44b09bbbe9fe168ef56750390f0 | 5,733 | py | Python | Youtube Bot Video Generator/videoscript.py | wasimakh2/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 8f6e1c7fcbd93f7da8f437cb4bf2d9c67c2932c2 | [
"MIT"
] | 1 | 2020-08-24T07:02:32.000Z | 2020-08-24T07:02:32.000Z | Youtube Bot Video Generator/videoscript.py | wasimakh2/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 8f6e1c7fcbd93f7da8f437cb4bf2d9c67c2932c2 | [
"MIT"
] | null | null | null | Youtube Bot Video Generator/videoscript.py | wasimakh2/Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader | 8f6e1c7fcbd93f7da8f437cb4bf2d9c67c2932c2 | [
"MIT"
] | 1 | 2021-01-25T17:09:35.000Z | 2021-01-25T17:09:35.000Z | import settings
import cv2
from VideoTypes import imageframe, standardredditformat
import generatemovie
import generatorclient
import datetime
import os
import shutil
import videouploader
import random
import pickle
from time import sleep
videoscripts = []
| 41.846715 | 117 | 0.631083 | import settings
import cv2
from VideoTypes import imageframe, standardredditformat
import generatemovie
import generatorclient
import datetime
import os
import shutil
import videouploader
import random
import pickle
from time import sleep
videoscripts = []
class VideoScriptEngine():
def __init... | 5,184 | 5 | 266 |
c7cec01c629502ed181bf15521238a3423e46732 | 258 | py | Python | start.py | ddpaimon/treedbclient | ff03343556090c0398ee1130a91b386e9e2f4cec | [
"MIT"
] | null | null | null | start.py | ddpaimon/treedbclient | ff03343556090c0398ee1130a91b386e9e2f4cec | [
"MIT"
] | null | null | null | start.py | ddpaimon/treedbclient | ff03343556090c0398ee1130a91b386e9e2f4cec | [
"MIT"
] | null | null | null | from tkinter import *
from main_window import MainWindow
if __name__ == "__main__":
root = Tk()
root.columnconfigure(0, weight=1)
root.columnconfigure(2, weight=1)
root.rowconfigure(0, weight=1)
m = MainWindow(root)
root.mainloop()
| 21.5 | 37 | 0.686047 | from tkinter import *
from main_window import MainWindow
if __name__ == "__main__":
root = Tk()
root.columnconfigure(0, weight=1)
root.columnconfigure(2, weight=1)
root.rowconfigure(0, weight=1)
m = MainWindow(root)
root.mainloop()
| 0 | 0 | 0 |
a927846d4e9a598f9eff23e33973c320f1038c9d | 28,220 | py | Python | sim_db/sim_db_lib.py | task123/sim_db | 892934693fc166640f6cbf7af905a2c0d48ea99b | [
"MIT"
] | null | null | null | sim_db/sim_db_lib.py | task123/sim_db | 892934693fc166640f6cbf7af905a2c0d48ea99b | [
"MIT"
] | null | null | null | sim_db/sim_db_lib.py | task123/sim_db | 892934693fc166640f6cbf7af905a2c0d48ea99b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Read and write parameters, results and metadata to the 'sim_db' database."""
# Copyright (C) 2017-2019 Håkon Austlid Taskén <hakon.tasken@gmail.com>
# Licenced under the MIT License.
import sim_db.src_command_line_tool.commands.helpers as helpers
import sqlite3
import argparse
import subproc... | 43.684211 | 80 | 0.545216 | # -*- coding: utf-8 -*-
"""Read and write parameters, results and metadata to the 'sim_db' database."""
# Copyright (C) 2017-2019 Håkon Austlid Taskén <hakon.tasken@gmail.com>
# Licenced under the MIT License.
import sim_db.src_command_line_tool.commands.helpers as helpers
import sqlite3
import argparse
import subproc... | 12,088 | 17 | 239 |
36ac6b6d184184fbc0b05f1ff60528053b819d9d | 14,351 | py | Python | SBW_GAN_TF/generator.py | huangleiBuaa/StochasticityBW | 11db7ed0238f0c7cd5f6e336a087fc1d0427b1e6 | [
"BSD-2-Clause"
] | 8 | 2020-03-23T15:46:13.000Z | 2022-03-25T03:11:17.000Z | SBW_GAN_TF/generator.py | huangleiBuaa/StochasticityBW | 11db7ed0238f0c7cd5f6e336a087fc1d0427b1e6 | [
"BSD-2-Clause"
] | null | null | null | SBW_GAN_TF/generator.py | huangleiBuaa/StochasticityBW | 11db7ed0238f0c7cd5f6e336a087fc1d0427b1e6 | [
"BSD-2-Clause"
] | 1 | 2022-03-25T03:11:20.000Z | 2022-03-25T03:11:20.000Z | from tensorflow.python.keras.models import Input, Model
from tensorflow.python.keras.layers import Dense, Reshape, Activation, Conv2D, Conv2DTranspose
from tensorflow.python.keras.layers import BatchNormalization, Add, Embedding, Concatenate
import numpy as np
import tensorflow as tf
from tensorflow.python.keras impor... | 54.774809 | 181 | 0.548464 | from tensorflow.python.keras.models import Input, Model
from tensorflow.python.keras.layers import Dense, Reshape, Activation, Conv2D, Conv2DTranspose
from tensorflow.python.keras.layers import BatchNormalization, Add, Embedding, Concatenate
import numpy as np
import tensorflow as tf
from tensorflow.python.keras impor... | 13,551 | 0 | 46 |
154902bea517a92105fa6ca2dc639b1aa8ad881c | 1,591 | py | Python | fossor/checks/loadavg.py | NeolithEra/fossor | d8dbdc40f2f16da601c317dfa74b83e3932c9bb3 | [
"BSD-2-Clause"
] | 165 | 2017-12-14T18:44:25.000Z | 2020-12-09T01:48:57.000Z | fossor/checks/loadavg.py | NeolithEra/fossor | d8dbdc40f2f16da601c317dfa74b83e3932c9bb3 | [
"BSD-2-Clause"
] | 12 | 2017-12-14T23:42:45.000Z | 2020-05-29T15:11:02.000Z | fossor/checks/loadavg.py | NeolithEra/fossor | d8dbdc40f2f16da601c317dfa74b83e3932c9bb3 | [
"BSD-2-Clause"
] | 32 | 2017-12-14T17:51:57.000Z | 2020-06-12T13:11:47.000Z | # Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
import os
from fossor.checks.check import Check
class LoadAvg(Check):
'''this Check will compare the current load average summaries against the count of ... | 43 | 122 | 0.614079 | # Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
import os
from fossor.checks.check import Check
class LoadAvg(Check):
'''this Check will compare the current load average summaries against the count of ... | 1,091 | 0 | 26 |
db7b405dd77b26c6f3e2362687a6b0991b3bd6de | 5,048 | py | Python | tests/app/clients/test_firetext.py | LouisStAmour/notifications-api | 16734595e70113d85fb10689017b2c30bab61fb3 | [
"MIT"
] | 10 | 2020-05-04T14:11:06.000Z | 2022-02-22T19:06:36.000Z | tests/app/clients/test_firetext.py | GouvQC/notification-api | e865b8b92a9a45c7cee006f427dcf77d71b09d6d | [
"MIT"
] | 554 | 2020-05-07T21:56:24.000Z | 2022-03-31T23:04:51.000Z | tests/app/clients/test_firetext.py | LouisStAmour/notifications-api | 16734595e70113d85fb10689017b2c30bab61fb3 | [
"MIT"
] | 4 | 2020-08-27T16:43:29.000Z | 2021-02-17T22:17:27.000Z | from requests import HTTPError
from urllib.parse import parse_qs
from requests.exceptions import ConnectTimeout, ReadTimeout
import pytest
import requests_mock
from app.clients.sms.firetext import get_firetext_responses, SmsClientResponseException, FiretextClientResponseException
| 36.057143 | 120 | 0.724643 | from requests import HTTPError
from urllib.parse import parse_qs
from requests.exceptions import ConnectTimeout, ReadTimeout
import pytest
import requests_mock
from app.clients.sms.firetext import get_firetext_responses, SmsClientResponseException, FiretextClientResponseException
def test_should_return_correct_deta... | 4,501 | 0 | 253 |
f4b37dcb02cb91970f72659ca8869f6a3bbb5643 | 1,532 | py | Python | day26_lists_NATO_alphabet/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day26_lists_NATO_alphabet/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day26_lists_NATO_alphabet/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | import random
# names = ['Alex', 'Beth', 'Carol', 'Dave', 'Kim', 'Sam', 'Heather', 'Hank']
# students_scores = {student:random.randint(1, 100) for student in names}
# passed_students = {student:score for (student, score) in students_scores.items() if score > 59}
# print(students_scores)
# print(passed_students)
... | 30.039216 | 103 | 0.622063 | import random
# names = ['Alex', 'Beth', 'Carol', 'Dave', 'Kim', 'Sam', 'Heather', 'Hank']
# students_scores = {student:random.randint(1, 100) for student in names}
# passed_students = {student:score for (student, score) in students_scores.items() if score > 59}
# print(students_scores)
# print(passed_students)
... | 297 | 0 | 25 |
41ee8bdcdc4e5cfd537d50225bfde851709ef2eb | 30,500 | py | Python | pyeccodes/defs/grib2/localConcepts/kwbc/shortName_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/grib2/localConcepts/kwbc/shortName_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/grib2/localConcepts/kwbc/shortName_def.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | import pyeccodes.accessors as _
| 36.396181 | 85 | 0.600557 | import pyeccodes.accessors as _
def load(h):
def wrapped(h):
discipline = h.get_l('discipline')
parameterCategory = h.get_l('parameterCategory')
parameterNumber = h.get_l('parameterNumber')
if discipline == 0 and parameterCategory == 1 and parameterNumber == 8:
retur... | 30,444 | 0 | 23 |
f855524a5a17dbd4474da10c04f38088efe0a849 | 4,279 | py | Python | gladiator/prepare/command.py | hellcat17/gladiator | 4f1ea65112dab04f584b148d23a150f28a94c434 | [
"Apache-2.0"
] | null | null | null | gladiator/prepare/command.py | hellcat17/gladiator | 4f1ea65112dab04f584b148d23a150f28a94c434 | [
"Apache-2.0"
] | null | null | null | gladiator/prepare/command.py | hellcat17/gladiator | 4f1ea65112dab04f584b148d23a150f28a94c434 | [
"Apache-2.0"
] | null | null | null | """Prepare OpenGL commands for use in templates."""
from enum import auto, Enum
from typing import Iterable, Mapping, Optional, Union
import attr
from gladiator.parse.command import Command, Type
from gladiator.prepare.enum import PreparedEnum
from gladiator.prepare.style import transform_symbol
from gladiator.optio... | 28.526667 | 87 | 0.714419 | """Prepare OpenGL commands for use in templates."""
from enum import auto, Enum
from typing import Iterable, Mapping, Optional, Union
import attr
from gladiator.parse.command import Command, Type
from gladiator.prepare.enum import PreparedEnum
from gladiator.prepare.style import transform_symbol
from gladiator.optio... | 1,387 | 761 | 269 |
c7393ff14c969a96e0698f982393eac0fd77f625 | 351 | py | Python | notebooks/bqm_functions.py | ozlemsalehi/qa-edu | 4b74a1d06820df36b710919c31a82a71b4e85d84 | [
"MIT"
] | 1 | 2021-10-10T03:35:03.000Z | 2021-10-10T03:35:03.000Z | notebooks/bqm_functions.py | ozlemsalehi/qa-edu | 4b74a1d06820df36b710919c31a82a71b4e85d84 | [
"MIT"
] | null | null | null | notebooks/bqm_functions.py | ozlemsalehi/qa-edu | 4b74a1d06820df36b710919c31a82a71b4e85d84 | [
"MIT"
] | null | null | null | """
This file contains all the functions used in the notebooks
under the Binary Quadratic Model section.
Prepared by Akash Narayanan B
"""
from dimod import BinaryQuadraticModel
# Task 3
linear = {'x1': 3, 'x2': -1, 'x3': 10, 'x4': 7}
quadratic = {('x1', 'x2'): 2, ('x1', 'x3'): -5, ('x2', 'x3'): 3, ('x3', 'x4'): 11... | 25.071429 | 82 | 0.621083 | """
This file contains all the functions used in the notebooks
under the Binary Quadratic Model section.
Prepared by Akash Narayanan B
"""
from dimod import BinaryQuadraticModel
# Task 3
linear = {'x1': 3, 'x2': -1, 'x3': 10, 'x4': 7}
quadratic = {('x1', 'x2'): 2, ('x1', 'x3'): -5, ('x2', 'x3'): 3, ('x3', 'x4'): 11... | 0 | 0 | 0 |
21724846cd453a1ea089631982f272aa7f74cddf | 754 | py | Python | project/delibere/migrations/0036_auto_20170922_1319.py | guglielmo/mosic2-db-delibere | a7c92adf42ad53023af47776c32baa2ee525f5e9 | [
"BSD-3-Clause"
] | null | null | null | project/delibere/migrations/0036_auto_20170922_1319.py | guglielmo/mosic2-db-delibere | a7c92adf42ad53023af47776c32baa2ee525f5e9 | [
"BSD-3-Clause"
] | null | null | null | project/delibere/migrations/0036_auto_20170922_1319.py | guglielmo/mosic2-db-delibere | a7c92adf42ad53023af47776c32baa2ee525f5e9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-09-22 13:19
from __future__ import unicode_literals
from django.db import migrations, models
| 27.925926 | 124 | 0.619363 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-09-22 13:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('delibere', '0035_auto_20170621_1621'),
]
operations = [
migrations.AlterFie... | 0 | 575 | 23 |
b4791417864a20c51bb22fe093517c0cb17c5969 | 2,605 | py | Python | classification_ScanObjectNN/ScanObjectNN.py | ma-xu/pointMLP-pytorch | 205669826d269972e2616b13198dd52f41c9992e | [
"Apache-2.0"
] | 95 | 2022-02-15T10:09:31.000Z | 2022-03-30T04:29:12.000Z | classification_ScanObjectNN/ScanObjectNN.py | ma-xu/pointMLP-pytorch | 205669826d269972e2616b13198dd52f41c9992e | [
"Apache-2.0"
] | 17 | 2022-02-16T06:41:09.000Z | 2022-03-31T13:00:09.000Z | classification_ScanObjectNN/ScanObjectNN.py | 13952522076/pointMLP-pytorch | 205669826d269972e2616b13198dd52f41c9992e | [
"Apache-2.0"
] | 13 | 2022-02-16T10:06:11.000Z | 2022-03-31T12:55:44.000Z | """
ScanObjectNN download: http://103.24.77.34/scanobjectnn/h5_files.zip
"""
import os
import sys
import glob
import h5py
import numpy as np
from torch.utils.data import Dataset
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
if __name__ == '__main__':
train = ScanObjectNN(1024)
test = ScanObjectNN(1024, ... | 32.160494 | 108 | 0.66142 | """
ScanObjectNN download: http://103.24.77.34/scanobjectnn/h5_files.zip
"""
import os
import sys
import glob
import h5py
import numpy as np
from torch.utils.data import Dataset
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
def download():
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.... | 2,021 | 7 | 172 |
a4a4356ef17d15a32870aceafc1ab8a92b4c9303 | 71 | py | Python | sgi/recursos_humanos/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | sgi/recursos_humanos/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | 8 | 2019-12-07T13:13:34.000Z | 2021-09-02T03:07:25.000Z | sgi/recursos_humanos/__init__.py | jorgevilaca82/SGI | c3f13d9e3e8f04377d9e23636dc8e35ed5ace35a | [
"MIT"
] | null | null | null | default_app_config = "sgi.recursos_humanos.apps.RecursosHumanosConfig"
| 35.5 | 70 | 0.873239 | default_app_config = "sgi.recursos_humanos.apps.RecursosHumanosConfig"
| 0 | 0 | 0 |
9903afe6a1227ea53c957090155382ddf95e9914 | 13,824 | py | Python | gntp/__init__.py | pcjacobse/sabnzbd | 494e72a9963a1810e69f4e0f69df7c9dfb9256b0 | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | gntp/__init__.py | pcjacobse/sabnzbd | 494e72a9963a1810e69f4e0f69df7c9dfb9256b0 | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | gntp/__init__.py | pcjacobse/sabnzbd | 494e72a9963a1810e69f4e0f69df7c9dfb9256b0 | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgor... | 27.105882 | 105 | 0.697844 | import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgor... | 2,062 | 212 | 354 |
838d7c175e3f9e7de18126370cf750f1cc4ae14d | 124 | py | Python | wsm/__init__.py | Rayologist/windows-sshd-manager | 4f78a0cdaa12fe3c2a785aca31066c3be886878b | [
"Apache-2.0"
] | 9 | 2022-02-09T09:09:43.000Z | 2022-02-09T09:10:06.000Z | wsm/__init__.py | Rayologist/windows-sshd-manager | 4f78a0cdaa12fe3c2a785aca31066c3be886878b | [
"Apache-2.0"
] | null | null | null | wsm/__init__.py | Rayologist/windows-sshd-manager | 4f78a0cdaa12fe3c2a785aca31066c3be886878b | [
"Apache-2.0"
] | null | null | null | from .backend import *
from .commands import *
check_config()
if not DB_PATH.is_file():
init_db()
init_firewall()
| 13.777778 | 25 | 0.693548 | from .backend import *
from .commands import *
check_config()
if not DB_PATH.is_file():
init_db()
init_firewall()
| 0 | 0 | 0 |
7c28df5688401e05150d6b2da6280bdaa82a847b | 3,088 | py | Python | drive/snippets/drive-v3/team_drive_snippets/recover_team_drives.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 479 | 2018-03-16T16:45:11.000Z | 2020-10-13T11:32:02.000Z | drive/snippets/drive-v3/team_drive_snippets/recover_team_drives.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 159 | 2018-03-28T20:03:56.000Z | 2020-10-13T06:00:08.000Z | drive/snippets/drive-v3/team_drive_snippets/recover_team_drives.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 493 | 2018-03-21T01:07:21.000Z | 2020-10-14T10:31:00.000Z | """Copyright 2022 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 or agreed to in writing, software
dist... | 36.329412 | 77 | 0.591645 | """Copyright 2022 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 or agreed to in writing, software
dist... | 0 | 0 | 0 |
5686d915b3397f6683c4fad42732286540a3a962 | 3,136 | py | Python | src/data_preparation/prepare_loc.py | tobiasraabe/locus-of-control | fe249bf8c85d163527d82e0c018e86bd37eff345 | [
"BSD-3-Clause"
] | null | null | null | src/data_preparation/prepare_loc.py | tobiasraabe/locus-of-control | fe249bf8c85d163527d82e0c018e86bd37eff345 | [
"BSD-3-Clause"
] | 56 | 2019-01-27T14:39:33.000Z | 2020-06-22T20:42:32.000Z | src/data_preparation/prepare_loc.py | tobiasraabe/locus-of-control | fe249bf8c85d163527d82e0c018e86bd37eff345 | [
"BSD-3-Clause"
] | 1 | 2018-03-01T09:19:00.000Z | 2018-03-01T09:19:00.000Z | import json
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from bld.project_paths import project_paths_join as ppj
# This list is ordered according to the item table in our paper.
PERCEIVED_CONTROL = [
"LOC_LIFES_COURSE",
"LOC_ACHIEVED_DESERVE",
"LOC_LUCK",
"LOC_OTHERS",... | 29.037037 | 87 | 0.642219 | import json
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from bld.project_paths import project_paths_join as ppj
# This list is ordered according to the item table in our paper.
PERCEIVED_CONTROL = [
"LOC_LIFES_COURSE",
"LOC_ACHIEVED_DESERVE",
"LOC_LUCK",
"LOC_OTHERS",... | 519 | 0 | 46 |
e99f8216a81c1cdba2df8dcfdf8089339385f03b | 5,265 | py | Python | misctools/archit.py | H4CKY54CK/misctools | e6f1f944046f07b808d19bb4e4c8fae6264eb428 | [
"MIT"
] | 3 | 2020-08-23T21:18:09.000Z | 2021-12-08T15:48:38.000Z | misctools/archit.py | H4CKY54CK/misctools | e6f1f944046f07b808d19bb4e4c8fae6264eb428 | [
"MIT"
] | 2 | 2020-04-14T09:18:54.000Z | 2020-07-13T06:09:22.000Z | misctools/archit.py | H4CKY54CK/misctools | e6f1f944046f07b808d19bb4e4c8fae6264eb428 | [
"MIT"
] | null | null | null | import os
import sys
import time
import shutil
import argparse
import traceback
import subprocess
from . import __version__
| 47.863636 | 225 | 0.605128 | import os
import sys
import time
import shutil
import argparse
import traceback
import subprocess
from . import __version__
def unarchit(args=None):
source = os.path.abspath(args.source)
base, suffix = os.path.splitext(source)
if suffix.lower() in ['.gz', '.bz2', '.xz']:
base, second = os.path.spl... | 5,049 | 0 | 91 |
62566eb6cd30c2061bec5af80d2812e59322c27e | 860 | py | Python | open_bus_pipelines/operators/api_bash_operator.py | OriHoch/open-bus-pipelines | ad8a5bcb2a84ebbae373c6ecc94fbcd666b81cde | [
"MIT"
] | 2 | 2021-11-14T00:06:18.000Z | 2022-02-15T13:50:37.000Z | open_bus_pipelines/operators/api_bash_operator.py | OriHoch/open-bus-pipelines | ad8a5bcb2a84ebbae373c6ecc94fbcd666b81cde | [
"MIT"
] | null | null | null | open_bus_pipelines/operators/api_bash_operator.py | OriHoch/open-bus-pipelines | ad8a5bcb2a84ebbae373c6ecc94fbcd666b81cde | [
"MIT"
] | 1 | 2021-11-23T07:53:22.000Z | 2021-11-23T07:53:22.000Z | import os
import json
import shlex
from .cli_bash_operator import CliBashOperator
from ..config import OPEN_BUS_PIPELINES_ROOTDIR
| 34.4 | 131 | 0.70814 | import os
import json
import shlex
from .cli_bash_operator import CliBashOperator
from ..config import OPEN_BUS_PIPELINES_ROOTDIR
class ApiBashOperator(CliBashOperator):
def __init__(self, config, **kwargs):
super(ApiBashOperator, self).__init__(self._get_cli_bash_operator_cmd(config), **kwargs)
de... | 606 | 18 | 104 |
75723ed8882576506d24cd1e306148f4fe9a583e | 341 | py | Python | main.py | kadin008/ArticleSpider | 51c9c79d7aec2d23333cd96b5e0e83c3ee677374 | [
"Apache-2.0"
] | null | null | null | main.py | kadin008/ArticleSpider | 51c9c79d7aec2d23333cd96b5e0e83c3ee677374 | [
"Apache-2.0"
] | null | null | null | main.py | kadin008/ArticleSpider | 51c9c79d7aec2d23333cd96b5e0e83c3ee677374 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
__author__: 'Patrick Wang'
__date__: '2019/2/28 14:52'
from scrapy.cmdline import execute
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# execute(["scrapy", "crawl", "jobbole"])
execute(["scrapy", "crawl", "zhihu"])
# execute(["scrapy"... | 21.3125 | 59 | 0.686217 | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
__author__: 'Patrick Wang'
__date__: '2019/2/28 14:52'
from scrapy.cmdline import execute
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# execute(["scrapy", "crawl", "jobbole"])
execute(["scrapy", "crawl", "zhihu"])
# execute(["scrapy"... | 0 | 0 | 0 |
7cd2c0657c5d91ac0480863e7350e58fe1fcdc05 | 4,517 | py | Python | prestodb/exceptions.py | highker/presto-python-client | 4f5be9c81950cbddd4579a9e55dfce6db54fb8b2 | [
"Apache-2.0"
] | null | null | null | prestodb/exceptions.py | highker/presto-python-client | 4f5be9c81950cbddd4579a9e55dfce6db54fb8b2 | [
"Apache-2.0"
] | null | null | null | prestodb/exceptions.py | highker/presto-python-client | 4f5be9c81950cbddd4579a9e55dfce6db54fb8b2 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 25.811429 | 81 | 0.615231 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 2,654 | 613 | 359 |
b186eb72fe48e7225c8c7512994e3ef73f7156df | 2,699 | py | Python | prody/tests/apps/test_prody_pca.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 210 | 2015-01-26T08:17:56.000Z | 2022-03-30T01:40:34.000Z | prody/tests/apps/test_prody_pca.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 555 | 2015-01-05T21:51:54.000Z | 2022-03-31T16:51:41.000Z | prody/tests/apps/test_prody_pca.py | grandevelia/ProDy | 7c725640a94c16543423c0756388998cb86a97ae | [
"MIT"
] | 99 | 2015-02-09T18:00:39.000Z | 2022-03-07T12:52:51.000Z | from os import remove
import shlex
from os.path import isfile, join, split, splitext
from prody.tests import TestCase, skipIf, skipUnless
from numpy.testing import *
try:
import numpy.testing.decorators as dec
except ImportError:
from numpy.testing import dec
from prody.tests.datafiles import TEMPDIR, pathDat... | 31.022989 | 74 | 0.586514 | from os import remove
import shlex
from os.path import isfile, join, split, splitext
from prody.tests import TestCase, skipIf, skipUnless
from numpy.testing import *
try:
import numpy.testing.decorators as dec
except ImportError:
from numpy.testing import dec
from prody.tests.datafiles import TEMPDIR, pathDat... | 1,781 | 475 | 23 |
7725ec364d6620e651e05ce578e7d17391e0e6ff | 1,414 | py | Python | talks/events/factories.py | alan-turing-institute/talks.ox | 5e172b7bb7296fcfc2d5c1b5978ec98a6643d90a | [
"Apache-2.0"
] | 5 | 2015-09-03T11:46:07.000Z | 2022-01-12T10:15:50.000Z | talks/events/factories.py | alan-turing-institute/talks.ox | 5e172b7bb7296fcfc2d5c1b5978ec98a6643d90a | [
"Apache-2.0"
] | 306 | 2015-01-05T10:16:56.000Z | 2021-06-10T08:00:31.000Z | talks/events/factories.py | alan-turing-institute/talks.ox | 5e172b7bb7296fcfc2d5c1b5978ec98a6643d90a | [
"Apache-2.0"
] | 5 | 2016-04-21T10:40:20.000Z | 2021-01-05T09:15:23.000Z | from __future__ import absolute_import
from datetime import datetime
import factory
from . import models
from talks.users.models import Collection, CollectionItem, CollectedDepartment
| 23.966102 | 78 | 0.73338 | from __future__ import absolute_import
from datetime import datetime
import factory
from . import models
from talks.users.models import Collection, CollectionItem, CollectedDepartment
class EventGroupFactory(factory.django.DjangoModelFactory):
class Meta:
model = models.EventGroup
class EventCollection... | 33 | 974 | 215 |
7873ab8bfeb4ee79e6303fa1dcf5e53421732720 | 126 | py | Python | edm_web1/app/track/apps.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | edm_web1/app/track/apps.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | 18 | 2020-06-05T18:17:40.000Z | 2022-03-11T23:25:21.000Z | edm_web1/app/track/apps.py | zhouli121018/nodejsgm | 0ccbc8acf61badc812f684dd39253d55c99f08eb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
| 15.75 | 39 | 0.785714 | from __future__ import unicode_literals
from django.apps import AppConfig
class TrackConfig(AppConfig):
name = 'track'
| 0 | 27 | 23 |
2c4404e3104ac6f6cfb652d20db04410a3d2b584 | 2,585 | py | Python | setup.py | ufzq/stagger | e88123e465f0f720f334b7f0960af52ffffd069d | [
"BSD-2-Clause"
] | 4 | 2015-01-25T18:58:10.000Z | 2016-09-21T04:10:31.000Z | setup.py | ufzq/stagger | e88123e465f0f720f334b7f0960af52ffffd069d | [
"BSD-2-Clause"
] | 1 | 2016-01-12T18:56:56.000Z | 2016-01-13T15:01:57.000Z | setup.py | ufzq/stagger | e88123e465f0f720f334b7f0960af52ffffd069d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# setup.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... | 38.58209 | 72 | 0.733075 | #!/usr/bin/env python3
#
# setup.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... | 0 | 0 | 0 |
04eff52184b988d1cc793b12b3a99112a4eafd58 | 1,243 | py | Python | python/multiprocessing/main.py | marvinklimke/pi | 5ecd16175c39f9e7a70e6e7ceb26155d4948b86f | [
"MIT"
] | null | null | null | python/multiprocessing/main.py | marvinklimke/pi | 5ecd16175c39f9e7a70e6e7ceb26155d4948b86f | [
"MIT"
] | null | null | null | python/multiprocessing/main.py | marvinklimke/pi | 5ecd16175c39f9e7a70e6e7ceb26155d4948b86f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Calculate the value of pi using multiprocessing in Python"""
from datetime import datetime
from multiprocessing import Pool
import os
from sys import argv
if __name__ == "__main__":
main()
| 24.86 | 94 | 0.608206 | #!/usr/bin/env python3
"""Calculate the value of pi using multiprocessing in Python"""
from datetime import datetime
from multiprocessing import Pool
import os
from sys import argv
def compute(args):
begin, end, num_steps = args
subtotal = 0.0
for i in range(begin, end):
x = (i + 0.5) / num_steps... | 973 | 0 | 46 |
d8dc135da44f05d9d3ca90831a0906ba17d225d9 | 3,533 | py | Python | tensorflow_datasets/text/squad_question_generation/squad_question_generation.py | vanshhhhh/datasets | aee32f95273ca3bfe83e09fb9b00ba4bf23597a5 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/squad_question_generation/squad_question_generation.py | vanshhhhh/datasets | aee32f95273ca3bfe83e09fb9b00ba4bf23597a5 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/text/squad_question_generation/squad_question_generation.py | vanshhhhh/datasets | aee32f95273ca3bfe83e09fb9b00ba4bf23597a5 | [
"Apache-2.0"
] | 1 | 2021-11-22T18:07:30.000Z | 2021-11-22T18:07:30.000Z | # coding=utf-8
# Copyright 2021 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... | 33.647619 | 100 | 0.669403 | # coding=utf-8
# Copyright 2021 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... | 0 | 0 | 0 |
0bd306ed8f7194f27a682ebda70b085b53ee2b23 | 159 | py | Python | json-load-transform-save/ujsonproc.py | rolando/python-benchmarks | 9ef4dc320983ef7ca3ff689b33f3b0c633388061 | [
"MIT"
] | 1 | 2016-06-23T11:29:01.000Z | 2016-06-23T11:29:01.000Z | json-load-transform-save/ujsonproc.py | rolando/python-benchmarks | 9ef4dc320983ef7ca3ff689b33f3b0c633388061 | [
"MIT"
] | null | null | null | json-load-transform-save/ujsonproc.py | rolando/python-benchmarks | 9ef4dc320983ef7ca3ff689b33f3b0c633388061 | [
"MIT"
] | null | null | null | import sys
from ujson import loads, dumps
for line in sys.stdin:
obj = loads(line)
sys.stdout.write(dumps(obj['actor']))
sys.stdout.write('\n')
| 15.9 | 41 | 0.660377 | import sys
from ujson import loads, dumps
for line in sys.stdin:
obj = loads(line)
sys.stdout.write(dumps(obj['actor']))
sys.stdout.write('\n')
| 0 | 0 | 0 |
6de6758fa523ec1489447da0b79cbce0ee433ec0 | 2,120 | py | Python | code/insert_sensordata_from_azure_queue.py | jurjanbrust/wsl2_mysql_grafana | df5e236897738f47d2f84d0cbff35e0f7ec6d364 | [
"MIT"
] | null | null | null | code/insert_sensordata_from_azure_queue.py | jurjanbrust/wsl2_mysql_grafana | df5e236897738f47d2f84d0cbff35e0f7ec6d364 | [
"MIT"
] | null | null | null | code/insert_sensordata_from_azure_queue.py | jurjanbrust/wsl2_mysql_grafana | df5e236897738f47d2f84d0cbff35e0f7ec6d364 | [
"MIT"
] | null | null | null | from azure.storage.queue import (
QueueClient,
TextBase64EncodePolicy,
TextBase64DecodePolicy
)
import os, uuid, time, json
import mysql.connector
from datetime import datetime
connect_str = "DefaultEndpointsProtocol=https;AccountName=replace;AccountKey=replacewithyours;EndpointSuffix=core.win... | 36.551724 | 180 | 0.734906 | from azure.storage.queue import (
QueueClient,
TextBase64EncodePolicy,
TextBase64DecodePolicy
)
import os, uuid, time, json
import mysql.connector
from datetime import datetime
connect_str = "DefaultEndpointsProtocol=https;AccountName=replace;AccountKey=replacewithyours;EndpointSuffix=core.win... | 1,193 | 0 | 23 |
65d1ca74db776761cd8564119bbc577e67c51c88 | 200 | py | Python | app/__init__.py | twitbox/candidate-sentiment-api | c06141963756a4c6251fbd53f3ddced422bd10b4 | [
"Unlicense",
"MIT"
] | 1 | 2017-09-12T12:18:13.000Z | 2017-09-12T12:18:13.000Z | app/__init__.py | twitbox/candidate-sentiment-api | c06141963756a4c6251fbd53f3ddced422bd10b4 | [
"Unlicense",
"MIT"
] | null | null | null | app/__init__.py | twitbox/candidate-sentiment-api | c06141963756a4c6251fbd53f3ddced422bd10b4 | [
"Unlicense",
"MIT"
] | null | null | null | from .controllers.twitter import search | 20 | 39 | 0.675 | from .controllers.twitter import search
def router(app):
@app.route('/')
def index():
return 'OK'
@app.route('/twitter/<hashtag>')
def search_twitter(hashtag):
return search(hashtag) | 138 | 0 | 23 |
79d19cfb9e26ce72a74fab548e234650eae67dbb | 57 | py | Python | python/testData/highlighting/continueInFinallyBlock.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/highlighting/continueInFinallyBlock.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/testData/highlighting/continueInFinallyBlock.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | while True:
try:
print("a")
finally:
continue | 11.4 | 14 | 0.578947 | while True:
try:
print("a")
finally:
continue | 0 | 0 | 0 |
9fce0a533c0967a19b5da21b4115ccd074cab091 | 582 | py | Python | studies/airfoil_optimizer/gradient_check.py | peterdsharpe/DawnDesignTool | 7c8b87db33e151cf50e07da982f51494ef84d80a | [
"MIT"
] | 3 | 2021-09-28T16:05:51.000Z | 2021-12-29T01:08:24.000Z | studies/airfoil_optimizer/gradient_check.py | peterdsharpe/DawnDesignTool | 7c8b87db33e151cf50e07da982f51494ef84d80a | [
"MIT"
] | 1 | 2021-12-08T17:35:41.000Z | 2021-12-08T17:35:41.000Z | studies/airfoil_optimizer/gradient_check.py | peterdsharpe/DawnDesignTool | 7c8b87db33e151cf50e07da982f51494ef84d80a | [
"MIT"
] | null | null | null | import copy
if __name__ == '__main__':
epss = np.logspace(-10, -1, 30)
baseline_objective = augmented_objective(x0)
xis = []
for eps in epss:
xi = copy.copy(x0)
xi[4] += eps
xis.append(xi)
objs = [augmented_objective(xi) for xi in xis]
# pool = mp.Pool(mp.cpu_count())
... | 25.304348 | 61 | 0.585911 | import copy
if __name__ == '__main__':
epss = np.logspace(-10, -1, 30)
baseline_objective = augmented_objective(x0)
xis = []
for eps in epss:
xi = copy.copy(x0)
xi[4] += eps
xis.append(xi)
objs = [augmented_objective(xi) for xi in xis]
# pool = mp.Pool(mp.cpu_count())
... | 0 | 0 | 0 |
984cd9e9856e57b6b0cd4778d04824c76290e492 | 2,190 | py | Python | awx/main/models/fact.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 2 | 2018-11-12T18:52:24.000Z | 2020-05-22T18:41:21.000Z | awx/main/models/fact.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 4 | 2020-04-29T23:03:16.000Z | 2022-03-01T23:56:09.000Z | awx/main/models/fact.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 9 | 2019-05-11T00:03:30.000Z | 2021-07-07T16:09:17.000Z | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
from django.db import models
from django.utils.translation import ugettext_lazy as _
from awx.main.fields import JSONBField
__all__ = ('Fact',)
logger = logging.getLogger('awx.main.models.fact')
class Fact(models.Model):
"""A model repr... | 30.84507 | 144 | 0.629224 | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
from django.db import models
from django.utils.translation import ugettext_lazy as _
from awx.main.fields import JSONBField
__all__ = ('Fact',)
logger = logging.getLogger('awx.main.models.fact')
class Fact(models.Model):
"""A model repr... | 942 | 99 | 105 |
92d5e207f5dc0651947ac8ccca6c9f69f1ca937e | 293 | py | Python | securex/SecureX-3/scripts/gunicorn.conf.py | CiscoDevNet/security-api-workshop--resources | ee7dbdb7909ee9689c4b061d74cdd6dbb4a8cd20 | [
"Apache-2.0"
] | 4 | 2020-10-13T16:08:11.000Z | 2021-11-28T11:44:45.000Z | securex/SecureX-3/scripts/gunicorn.conf.py | CiscoDevNet/security-api-workshop--resources | ee7dbdb7909ee9689c4b061d74cdd6dbb4a8cd20 | [
"Apache-2.0"
] | 1 | 2021-02-16T18:07:24.000Z | 2021-02-16T18:07:24.000Z | securex/SecureX-3/scripts/gunicorn.conf.py | CiscoDevNet/security-api-workshop--resources | ee7dbdb7909ee9689c4b061d74cdd6dbb4a8cd20 | [
"Apache-2.0"
] | 8 | 2020-10-16T15:30:28.000Z | 2021-03-25T15:28:49.000Z | # import multiprocessing
pidfile = 'flask_app.pid'
workers = 2
# workers = multiprocessing.cpu_count() * 2 + 1
bind = '0.0.0.0:80'
accesslog = './logs/access.log'
errorlog = './logs/error.log'
#certfile = './certs/local.cer'
#keyfile = './certs/local.key'
# user = 'ubuntu'
# group = 'ubuntu' | 24.416667 | 47 | 0.665529 | # import multiprocessing
pidfile = 'flask_app.pid'
workers = 2
# workers = multiprocessing.cpu_count() * 2 + 1
bind = '0.0.0.0:80'
accesslog = './logs/access.log'
errorlog = './logs/error.log'
#certfile = './certs/local.cer'
#keyfile = './certs/local.key'
# user = 'ubuntu'
# group = 'ubuntu' | 0 | 0 | 0 |
ca9a3657148f07444639079c4bf6b45a6d685933 | 1,164 | py | Python | src/discussion/management/commands/remove_low_quality_content.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/discussion/management/commands/remove_low_quality_content.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/discussion/management/commands/remove_low_quality_content.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django.db.models.functions import Length
from user.models import User
from discussion.models import Thread
import uuid
from utils.siftscience import decisions_api, events_api
| 34.235294 | 119 | 0.620275 | from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django.db.models.functions import Length
from user.models import User
from discussion.models import Thread
import uuid
from utils.siftscience import decisions_api, events_api
class Command(BaseCommand)... | 815 | 6 | 50 |
72c693fbfd1853a2f9b44a4dafbf326095a24308 | 23,027 | py | Python | pyzoo/zoo/automl/search/ray_tune_search_engine.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/automl/search/ray_tune_search_engine.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/automl/search/ray_tune_search_engine.py | ankitdobhal/analytics-zoo | b8374bcd6c73bba49fe0b0ab075528cdd94cf2af | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.365348 | 100 | 0.537065 | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 11,125 | 11 | 441 |
48c5f6e971f56e8aa3465449742bc2aac20738cb | 2,409 | py | Python | mmseg/datasets/waymo_depth_datset.py | anhvth/Swin-Transformer-Semantic-Segmentation | 31f69fe98de90cbf51bc9910f6fb777b0561bd4e | [
"Apache-2.0"
] | null | null | null | mmseg/datasets/waymo_depth_datset.py | anhvth/Swin-Transformer-Semantic-Segmentation | 31f69fe98de90cbf51bc9910f6fb777b0561bd4e | [
"Apache-2.0"
] | null | null | null | mmseg/datasets/waymo_depth_datset.py | anhvth/Swin-Transformer-Semantic-Segmentation | 31f69fe98de90cbf51bc9910f6fb777b0561bd4e | [
"Apache-2.0"
] | null | null | null | from .custom import *
@DATASETS.register_module(force=True) | 43.017857 | 81 | 0.579909 | from .custom import *
@DATASETS.register_module(force=True)
class WaymoDepthDataset(CustomDataset):
def __init__(self, *args, depth_dir=None, depth_map_suffix='.npy',**kwargs):
self.depth_dir = depth_dir
self.depth_map_suffix = depth_map_suffix
super(WaymoDepthDataset, self).__init__(*args... | 375 | 1,952 | 22 |
996a8a1128b5be33b3b9ae21ba65e8dc91142069 | 1,167 | py | Python | index.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | index.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | index.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | import os
from utilidades.consola import *
from CriptografiaModerna.menuCM import menuCM
from CriptografiaClasica.menuCC import menuCC
#DEFINICIÓN DE VARIABLES
#DEFINICIÓN DE FUNCIONES
limpiarPantalla()
iniciarMenu()
despedida()
input('')
limpiarPantalla() | 22.442308 | 81 | 0.521851 | import os
from utilidades.consola import *
from CriptografiaModerna.menuCM import menuCM
from CriptografiaClasica.menuCC import menuCC
#DEFINICIÓN DE VARIABLES
#DEFINICIÓN DE FUNCIONES
def iniciarMenu():
cont = 0
eleccion = 'seguir'
output_config = 5
menu = [
'[1] Criptografía C... | 874 | 0 | 23 |
3e8649d6ffb3892810d5e3b3d26d82ac9734c0ff | 3,284 | py | Python | index_cli/main.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/main.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | index_cli/main.py | lishnih/index_cli | 57f23d5df5168bcc73e23e0eeabbb8317014585b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Stan 2012-03-12
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import sys
import os
import logging
from importlib import import_module
from .core.types23 import *
from .core.db import getDbUri, openDbUri
from .core.r... | 30.981132 | 80 | 0.678136 | #!/usr/bin/env python
# coding=utf-8
# Stan 2012-03-12
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import sys
import os
import logging
from importlib import import_module
from .core.types23 import *
from .core.db import getDbUri, openDbUri
from .core.r... | 3,004 | 0 | 23 |
a786d47f5e861416affdf90f0ab36292e84ae8ee | 4,447 | py | Python | mri_works/NodeEditor/modules/File_IO/Save_image_nii_gz.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 2 | 2020-08-20T21:00:53.000Z | 2021-08-16T15:28:51.000Z | mri_works/NodeEditor/modules/File_IO/Save_image_nii_gz.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 3 | 2020-09-24T06:50:43.000Z | 2020-12-15T11:02:04.000Z | mri_works/NodeEditor/modules/File_IO/Save_image_nii_gz.py | montigno/mri_works | 8ec6ff1500aa34d3540e44e4b0148023cf821f61 | [
"CECILL-B"
] | 1 | 2020-08-20T21:00:59.000Z | 2020-08-20T21:00:59.000Z |
##############################################################################
##############################################################################
##############################################################################
###################################################... | 35.015748 | 115 | 0.506634 | class Save_NiiGz:
def __init__(self, image=[[0.0]], filepath='path', **options):
import nibabel as nib
import numpy as np
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
if type(image).__name__ == 'list':
image = ... | 3,721 | -5 | 383 |
bc5269769868f479d59e7a9477cb82de75d75760 | 19,744 | py | Python | dataloader.py | gregersn/Super-SloMo | 11f3b562ca44c068b847da33e09e4087adc1c032 | [
"MIT"
] | null | null | null | dataloader.py | gregersn/Super-SloMo | 11f3b562ca44c068b847da33e09e4087adc1c032 | [
"MIT"
] | null | null | null | dataloader.py | gregersn/Super-SloMo | 11f3b562ca44c068b847da33e09e4087adc1c032 | [
"MIT"
] | null | null | null | import torch.utils.data as data
from PIL import Image
import os
import os.path
import random
def _make_dataset(dir):
"""
Creates a 2D list of all the frames in N clips containing
M frames each.
2D List Structure:
[[frame00, frame01,...frameM] <-- clip0
[frame00, frame01,...frameM] <-- clip... | 29.293769 | 132 | 0.538341 | import torch.utils.data as data
from PIL import Image
import os
import os.path
import random
def _make_dataset(dir):
"""
Creates a 2D list of all the frames in N clips containing
M frames each.
2D List Structure:
[[frame00, frame01,...frameM] <-- clip0
[frame00, frame01,...frameM] <-- clip... | 160 | 0 | 31 |
40f10ba9cba8e68dff7b7eb5342f4e0f3d77da91 | 215,751 | py | Python | boto3_type_annotations_with_docs/boto3_type_annotations/greengrass/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/greengrass/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/greengrass/client.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
| 49.850046 | 525 | 0.544276 | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def associate_role_to_group(self, GroupId: str, RoleArn: str = None) -> D... | 0 | 215,512 | 23 |
d4d0c054bd8c6ab251cce470a6372d0eed7bc869 | 38,962 | py | Python | app/ariadicom.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | 3 | 2021-02-25T13:19:52.000Z | 2021-03-03T03:46:46.000Z | app/ariadicom.py | MedPhyDO/pygqa | 580b2c6028d2299790a38262b795b8409cbfcc37 | [
"MIT"
] | null | null | null | app/ariadicom.py | MedPhyDO/pygqa | 580b2c6028d2299790a38262b795b8409cbfcc37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = "R. Bauer"
__copyright__ = "MedPhyDO - Machbarkeitsstudien des Instituts für Medizinische Strahlenphysik und Strahlenschutz am Klinikum Dortmund im Rahmen von Bachelor und Masterarbeiten an der TU-Dortmund / FH-Dortmund"
__credits__ = ["R.Bauer", "K.Loot"]
__license__ = "MIT"
__ver... | 35.876611 | 209 | 0.523022 | # -*- coding: utf-8 -*-
__author__ = "R. Bauer"
__copyright__ = "MedPhyDO - Machbarkeitsstudien des Instituts für Medizinische Strahlenphysik und Strahlenschutz am Klinikum Dortmund im Rahmen von Bachelor und Masterarbeiten an der TU-Dortmund / FH-Dortmund"
__credits__ = ["R.Bauer", "K.Loot"]
__license__ = "MIT"
__ver... | 13,532 | 0 | 83 |
3f1054735f9d61a24ad850ea7ddd8b84f561b898 | 1,451 | py | Python | evoware/scripts/resetfile.py | graik/evowarepy | 4ed2fbebb808b6be75479790ee23b19cb50b3039 | [
"Apache-2.0"
] | 2 | 2019-03-08T08:36:24.000Z | 2019-03-11T11:59:40.000Z | evoware/scripts/resetfile.py | graik/evowarepy | 4ed2fbebb808b6be75479790ee23b19cb50b3039 | [
"Apache-2.0"
] | 1 | 2015-03-15T13:03:44.000Z | 2015-03-15T13:03:44.000Z | evoware/scripts/resetfile.py | graik/evowarepy | 4ed2fbebb808b6be75479790ee23b19cb50b3039 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
## evoware/py -- python modules for Evoware scripting
## Copyright 2014 - 2019 Raik Gruenberg
##
## 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
##
## ht... | 27.377358 | 77 | 0.610613 | #!/usr/bin/env python
## evoware/py -- python modules for Evoware scripting
## Copyright 2014 - 2019 Raik Gruenberg
##
## 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
##
## ht... | 231 | 0 | 23 |
56442242124bf91fdda8f794a68f6a9f91ccba36 | 1,240 | py | Python | LESO/test.py | thesethtruth/WB-thesis-model | f786d15fa446e8c089431853a82aa4d577e13f20 | [
"MIT"
] | null | null | null | LESO/test.py | thesethtruth/WB-thesis-model | f786d15fa446e8c089431853a82aa4d577e13f20 | [
"MIT"
] | null | null | null | LESO/test.py | thesethtruth/WB-thesis-model | f786d15fa446e8c089431853a82aa4d577e13f20 | [
"MIT"
] | null | null | null | # test.py
# a list of attributes a component should have for sure
basic = [
'merit_tag',
'styling',
'dof',
'lower',
'upper',
'lifetime',
'capex',
'opex',
'variable_cost',
'variable_income',
]
power_control = [
'positive',
'negative',
]
| 23.396226 | 76 | 0.552419 | # test.py
# a list of attributes a component should have for sure
basic = [
'merit_tag',
'styling',
'dof',
'lower',
'upper',
'lifetime',
'capex',
'opex',
'variable_cost',
'variable_income',
]
power_control = [
'positive',
'negative',
]
def attribute_test(component):
... | 930 | 0 | 23 |
1b6dec9d5c8deee6cd01b4c6307a5be4fdde7f1a | 13,138 | py | Python | MATLAB_path_generation/network_som.py | AlexRookie/neurocluster | 685e4c2930e7af68b09a5ae8ed7008936d6e49d4 | [
"BSD-2-Clause"
] | null | null | null | MATLAB_path_generation/network_som.py | AlexRookie/neurocluster | 685e4c2930e7af68b09a5ae8ed7008936d6e49d4 | [
"BSD-2-Clause"
] | null | null | null | MATLAB_path_generation/network_som.py | AlexRookie/neurocluster | 685e4c2930e7af68b09a5ae8ed7008936d6e49d4 | [
"BSD-2-Clause"
] | null | null | null | import tensorflow as tf
#from tensorflow import keras
#from tensorflow.keras import backend as K
import numpy as np
#import matplotlib.pyplot as plt
from time import sleep
#=======================================================================================#
class SOMLayer(tf.keras.layers.Layer):
"""
Self-... | 40.674923 | 160 | 0.590349 | import tensorflow as tf
#from tensorflow import keras
#from tensorflow.keras import backend as K
import numpy as np
#import matplotlib.pyplot as plt
from time import sleep
class Network:
def __init__(self):
self.model = []
self.map_size = None
self.units = None
self.classes = No... | 5,413 | 6,120 | 131 |
b5e67a019e3fa2d2d081a184ac33d2894fe68755 | 345 | py | Python | 034_Aumentos_multiplos.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | 034_Aumentos_multiplos.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | 034_Aumentos_multiplos.py | fabioeomedeiros/Python-Base | ef9c1c66b3221f71d1c8dcaf4c2f86503712e9f1 | [
"MIT"
] | null | null | null | # 034_Aumentos_multiplos.py
print()
salario = float(input("Salário atual: R$"))
print()
# if (salario <= 1250):
# salario *= 1.15 # -> salario = salario * 1.15
# else:
# salario *= 1.10 # -> salario = salario * 1.10
salario = salario * 1.15 if salario<= 1250 else salario * 1.10
print(f"Seu novo salário será:... | 23 | 62 | 0.628986 | # 034_Aumentos_multiplos.py
print()
salario = float(input("Salário atual: R$"))
print()
# if (salario <= 1250):
# salario *= 1.15 # -> salario = salario * 1.15
# else:
# salario *= 1.10 # -> salario = salario * 1.10
salario = salario * 1.15 if salario<= 1250 else salario * 1.10
print(f"Seu novo salário será:... | 0 | 0 | 0 |
c9e87550b730c5f553198eebd8acac9773639a86 | 898 | py | Python | tests/ctrl_c_test.py | twosigma/uberjob | e8afcadf8ca0cca8583b4d24ca13d000ccbf52c6 | [
"Apache-2.0"
] | 11 | 2020-09-27T13:15:29.000Z | 2022-03-08T17:13:07.000Z | tests/ctrl_c_test.py | twosigma/uberjob | e8afcadf8ca0cca8583b4d24ca13d000ccbf52c6 | [
"Apache-2.0"
] | 8 | 2020-11-13T21:52:11.000Z | 2022-02-05T20:59:51.000Z | tests/ctrl_c_test.py | twosigma/uberjob | e8afcadf8ca0cca8583b4d24ca13d000ccbf52c6 | [
"Apache-2.0"
] | 2 | 2021-05-18T01:22:50.000Z | 2021-06-16T17:43:19.000Z | #
# Copyright 2020 Two Sigma Open Source, 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 or agree... | 29.933333 | 84 | 0.727171 | #
# Copyright 2020 Two Sigma Open Source, 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 or agree... | 127 | 0 | 23 |
fa103c52f70424ba4b8057f67aac8aa5fac1d2df | 782 | py | Python | contests_atcoder/abc175/abc175_e_np.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | contests_atcoder/abc175/abc175_e_np.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | 1 | 2021-01-02T06:36:51.000Z | 2021-01-02T06:36:51.000Z | contests_atcoder/abc175/abc175_e_np.py | takelifetime/competitive-programming | e7cf8ef923ccefad39a1727ca94c610d650fcb76 | [
"BSD-2-Clause"
] | null | null | null | from collections import defaultdict
import numpy as np
r, c, k = map(int, input().split())
items = np.zeros((r, c), np.int32)
for _ in range(k):
y, x, v = map(int, input().split())
items[y - 1, x - 1] = v
dp = np.zeros((r, c, 4), np.int64)
for y in range(r):
for x in range(c):
dp[y, x, 0] = max(... | 30.076923 | 106 | 0.446292 | from collections import defaultdict
import numpy as np
r, c, k = map(int, input().split())
items = np.zeros((r, c), np.int32)
for _ in range(k):
y, x, v = map(int, input().split())
items[y - 1, x - 1] = v
dp = np.zeros((r, c, 4), np.int64)
for y in range(r):
for x in range(c):
dp[y, x, 0] = max(... | 0 | 0 | 0 |
ed08999c58b13ae8b6317ac1085c46f6e2599ce6 | 1,536 | py | Python | examples/direct_shape_optimization/hesaffBaum.py | rdguez-mariano/affnet | a3f0bb32d9001d1daf024f38d29867f37816ea78 | [
"MIT"
] | 211 | 2017-11-21T11:42:49.000Z | 2022-03-17T12:42:54.000Z | examples/direct_shape_optimization/hesaffBaum.py | rdguez-mariano/affnet | a3f0bb32d9001d1daf024f38d29867f37816ea78 | [
"MIT"
] | 31 | 2017-12-31T18:47:49.000Z | 2020-05-26T14:43:53.000Z | examples/direct_shape_optimization/hesaffBaum.py | rdguez-mariano/affnet | a3f0bb32d9001d1daf024f38d29867f37816ea78 | [
"MIT"
] | 47 | 2017-12-04T01:03:23.000Z | 2022-03-18T11:50:28.000Z | #!/usr/bin/python2 -utt
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import numpy as np
import sys
import os
import time
from PIL import Image
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.optim as optim
from tqdm import tqdm
import math
import torch.nn.functional ... | 30.117647 | 154 | 0.763672 | #!/usr/bin/python2 -utt
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import numpy as np
import sys
import os
import time
from PIL import Image
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.optim as optim
from tqdm import tqdm
import math
import torch.nn.functional ... | 0 | 0 | 0 |
d816df9d1e5c02c753f0fea53b0d3108eb531074 | 765 | py | Python | packages/pyre/schemata/EnvVar.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/schemata/EnvVar.py | rtburns-jpl/pyre | ffc4fc1b2936e355f709d084eb4055954960b3a2 | [
"BSD-3-Clause"
] | 1 | 2021-06-10T23:42:13.000Z | 2021-06-10T23:42:13.000Z | packages/pyre/schemata/EnvVar.py | jlmaurer/pyre | 6af38a83621d7d6228d147b4bb94f97fbb10f6e2 | [
"BSD-3-Clause"
] | 2 | 2020-08-31T18:07:52.000Z | 2021-12-10T08:54:39.000Z | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
# externals
import os
# superclass
from .String import String
# declaration
class EnvVar(String):
"""
A type declarator for strings whose default values are associated with an environment variable
"""
... | 20.131579 | 98 | 0.639216 | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
# externals
import os
# superclass
from .String import String
# declaration
class EnvVar(String):
"""
A type declarator for strings whose default values are associated with an environment variable
"""
... | 322 | 0 | 26 |
75b598f5df23bfbeb73e495c28f7ea6456fc6405 | 1,367 | py | Python | src/tap/stream/load.py | lmmx/tap | d60ce0ec9b4b0545b5ed2b3dfeea956457999b8d | [
"MIT"
] | null | null | null | src/tap/stream/load.py | lmmx/tap | d60ce0ec9b4b0545b5ed2b3dfeea956457999b8d | [
"MIT"
] | 19 | 2021-02-15T23:18:35.000Z | 2021-11-04T11:32:40.000Z | src/tap/stream/load.py | lmmx/tap | d60ce0ec9b4b0545b5ed2b3dfeea956457999b8d | [
"MIT"
] | null | null | null | from ..share.cal import parse_abs_from_rel_date
from .streams import Stream
__all__ = ["load_stream"]
def load_stream(
programme="Today",
station="r4",
broadcaster="bbc",
ymd=None,
ymd_ago=None,
**stream_opts,
):
"""
Create a `Stream` for a specific episode of a radio programme from t... | 35.973684 | 88 | 0.697147 | from ..share.cal import parse_abs_from_rel_date
from .streams import Stream
__all__ = ["load_stream"]
def load_stream(
programme="Today",
station="r4",
broadcaster="bbc",
ymd=None,
ymd_ago=None,
**stream_opts,
):
"""
Create a `Stream` for a specific episode of a radio programme from t... | 0 | 0 | 0 |
1c350cff265b3d8016a43c446d64999c2d32b3e3 | 6,479 | py | Python | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_packages/test_skills/test_generic_seller/test_dialogues.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 38.337278 | 89 | 0.656428 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 0 | 0 | 0 |
dc48bed3180a4802fc80473edc5b04249f1db382 | 1,295 | py | Python | data/visualizer/viz.py | PACE-challenge/Cluster-Editing-PACE-2021-instances- | 67f5df368c400f15fa2527ea1eb48ac1bd6a2d7a | [
"CC0-1.0"
] | 1 | 2021-08-23T14:47:55.000Z | 2021-08-23T14:47:55.000Z | data/visualizer/viz.py | PACE-challenge/Cluster-Editing-PACE-2021-instances- | 67f5df368c400f15fa2527ea1eb48ac1bd6a2d7a | [
"CC0-1.0"
] | null | null | null | data/visualizer/viz.py | PACE-challenge/Cluster-Editing-PACE-2021-instances- | 67f5df368c400f15fa2527ea1eb48ac1bd6a2d7a | [
"CC0-1.0"
] | 1 | 2022-02-28T20:42:10.000Z | 2022-02-28T20:42:10.000Z | import numpy as np
import matplotlib.pyplot as plt
import sys
S = read_instance(sys.argv[1])
plt.hist(S.flatten(), bins=np.linspace(0, 1, 200))
plt.title("Histogram of similarity values")
plt.xlabel("Similarity")
plt.ylabel("Frequency")
plt.savefig(sys.argv[1]+"_viz2.pdf", dpi=400)
plt.close()
n = len(S)
x = np.arang... | 23.981481 | 59 | 0.559073 | import numpy as np
import matplotlib.pyplot as plt
import sys
def read_instance(filename):
if filename.endswith(".csv"):
return np.loadtxt(filename, delimiter=', ')
assert(filename.endswith(".gr"))
# adjacency matrix is the similaity matrix in this case
S = None
f = open(filename)
p_rea... | 686 | 0 | 23 |
193ffbb9d91b75344c0042d5ef6cd59b2ea7f4af | 4,850 | py | Python | test/base/tool_shed_util.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | test/base/tool_shed_util.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | test/base/tool_shed_util.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | 3 | 2015-02-22T13:34:16.000Z | 2020-10-01T01:28:04.000Z | import logging
import os
import sys
cwd = os.getcwd()
if cwd not in sys.path:
sys.path.append( cwd )
new_path = [ os.path.join( cwd, "lib" ) ]
if new_path not in sys.path:
new_path.extend( sys.path )
sys.path = new_path
from galaxy.util import parse_xml
log = logging.getLogger(__name__)
# Set a 10 minu... | 50 | 142 | 0.573402 | import logging
import os
import sys
cwd = os.getcwd()
if cwd not in sys.path:
sys.path.append( cwd )
new_path = [ os.path.join( cwd, "lib" ) ]
if new_path not in sys.path:
new_path.extend( sys.path )
sys.path = new_path
from galaxy.util import parse_xml
log = logging.getLogger(__name__)
# Set a 10 minu... | 0 | 0 | 0 |
de4918caee09ec92475c1349ee971e4eb711dfbe | 273 | py | Python | tudo/ex011.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | 1 | 2021-07-08T00:35:57.000Z | 2021-07-08T00:35:57.000Z | tudo/ex011.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | tudo/ex011.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | largura = float(input('Qual a largura da parede em metros? '))
altura = float(input('Qual a altura da parede em metros? '))
area = largura * altura
print(f'A área dessa parede é: {area}m². ')
tinta = area / 2
print(f'Será usado {tinta}L de tinta para cada metro quadrado.') | 45.5 | 64 | 0.70696 | largura = float(input('Qual a largura da parede em metros? '))
altura = float(input('Qual a altura da parede em metros? '))
area = largura * altura
print(f'A área dessa parede é: {area}m². ')
tinta = area / 2
print(f'Será usado {tinta}L de tinta para cada metro quadrado.') | 0 | 0 | 0 |
cf39502934ab9e24950e06af4ca528a1d9074261 | 535 | py | Python | app/user/models/profile.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | app/user/models/profile.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | app/user/models/profile.py | NicolefAvella/ApiMovie | 4860b312f62dee73de6015c3029e75a6045f79a1 | [
"MIT"
] | null | null | null | from django.db import models
class Profile(models.Model):
"""Profile model."""
user = models.OneToOneField('user.User', on_delete=models.CASCADE)
picture = models.ImageField(
'profile picture',
upload_to='user/pictures/',
blank=True,
null=True
)
biography = models... | 24.318182 | 70 | 0.674766 | from django.db import models
class Profile(models.Model):
"""Profile model."""
user = models.OneToOneField('user.User', on_delete=models.CASCADE)
picture = models.ImageField(
'profile picture',
upload_to='user/pictures/',
blank=True,
null=True
)
biography = models... | 27 | 0 | 27 |
adc436be93d84dc86cd6f82501d3b84b9e1f875f | 628 | py | Python | ABC159D/resolve.py | staguchi0703/prob_boot_camp_medium | d6f31b3e50230877efb2ebfef40f90ef6468bfc7 | [
"MIT"
] | null | null | null | ABC159D/resolve.py | staguchi0703/prob_boot_camp_medium | d6f31b3e50230877efb2ebfef40f90ef6468bfc7 | [
"MIT"
] | null | null | null | ABC159D/resolve.py | staguchi0703/prob_boot_camp_medium | d6f31b3e50230877efb2ebfef40f90ef6468bfc7 | [
"MIT"
] | null | null | null | def resolve():
'''
code here
求めるものは
k番目のボールを除いた N−1個のボールから、書かれている整数が等しいような異なる2つのボールを選び出す方法
言い換えて
①同じ数から2個選ぶ組み合わせの和
②k番目のボールを除いた N−1個のボールから、K番目のボールと同じ数を選ぶ数
※選ぶボールとペアになっていた個数を数え上げて引く
①-②
'''
import collections
N = int(input())
A_list = [int(item) for ite... | 19.030303 | 59 | 0.613057 | def resolve():
'''
code here
求めるものは
k番目のボールを除いた N−1個のボールから、書かれている整数が等しいような異なる2つのボールを選び出す方法
言い換えて
①同じ数から2個選ぶ組み合わせの和
②k番目のボールを除いた N−1個のボールから、K番目のボールと同じ数を選ぶ数
※選ぶボールとペアになっていた個数を数え上げて引く
①-②
'''
import collections
N = int(input())
A_list = [int(item) for ite... | 0 | 0 | 0 |
61c62aec87289839c0bbe7e36af25de69071130f | 6,699 | py | Python | pysyncrosim/environment.py | syncrosim/pysyncrosim | 20c0005674b7dbcef19c233dfa7db95e0d9d451e | [
"MIT"
] | null | null | null | pysyncrosim/environment.py | syncrosim/pysyncrosim | 20c0005674b7dbcef19c233dfa7db95e0d9d451e | [
"MIT"
] | 6 | 2021-12-27T16:42:19.000Z | 2022-01-13T21:10:28.000Z | pysyncrosim/environment.py | syncrosim/pysyncrosim | 20c0005674b7dbcef19c233dfa7db95e0d9d451e | [
"MIT"
] | null | null | null | import os
import pandas as pd
def runtime_input_folder(scenario, datasheet_name):
"""
Creates a SyncroSim Datasheet input folder.
Parameters
----------
scenario : Scenario
Scenario class instance.
datasheet_name : String
Name of SyncroSim Datasheet.
Returns
-------
... | 29.253275 | 78 | 0.609494 | import os
import pandas as pd
def runtime_input_folder(scenario, datasheet_name):
"""
Creates a SyncroSim Datasheet input folder.
Parameters
----------
scenario : Scenario
Scenario class instance.
datasheet_name : String
Name of SyncroSim Datasheet.
Returns
-------
... | 1,853 | 0 | 104 |
5d04a1726570f54dbd238fae0bb455d7ae1425df | 12,970 | py | Python | tools/extStringCppParser.py | Mu-L/palanteer | ead425a0cf05dfe6ce178c0a72f19bfc4ff743b1 | [
"MIT"
] | null | null | null | tools/extStringCppParser.py | Mu-L/palanteer | ead425a0cf05dfe6ce178c0a72f19bfc4ff743b1 | [
"MIT"
] | null | null | null | tools/extStringCppParser.py | Mu-L/palanteer | ead425a0cf05dfe6ce178c0a72f19bfc4ff743b1 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# The MIT License (MIT)
#
# Copyright(c) 2021, Damien Feneyrou <dfeneyrou@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in the Software without restriction, including w... | 34.221636 | 131 | 0.537471 | #! /usr/bin/env python3
# The MIT License (MIT)
#
# Copyright(c) 2021, Damien Feneyrou <dfeneyrou@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files(the "Software"), to deal
# in the Software without restriction, including w... | 9,097 | 0 | 69 |
e55bf99f4d0d8b617d13272dc1499461cf5c6975 | 632 | py | Python | okie/tasks/migrations/0004_auto_20210528_1622.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | 1 | 2021-06-22T06:31:56.000Z | 2021-06-22T06:31:56.000Z | okie/tasks/migrations/0004_auto_20210528_1622.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | null | null | null | okie/tasks/migrations/0004_auto_20210528_1622.py | immortal-zeus/Django-task_dis | 10e99997893d4aabc2305969894e49f2873c17b7 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.3 on 2021-05-28 10:52
from django.db import migrations, models
| 26.333333 | 97 | 0.602848 | # Generated by Django 3.2.3 on 2021-05-28 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0003_rename_user_tuser'),
]
operations = [
migrations.AlterField(
model_name='tasks',
name='task_descriptio... | 0 | 518 | 23 |
1be6a2ef1e1199d71dec9476b340096db69dcdad | 174 | py | Python | codes/1/104.py | BigShuang/python-introductory-exercises | 9b8d391ce5fcbd12a654aba1c62a746ddb52a42d | [
"MIT"
] | null | null | null | codes/1/104.py | BigShuang/python-introductory-exercises | 9b8d391ce5fcbd12a654aba1c62a746ddb52a42d | [
"MIT"
] | null | null | null | codes/1/104.py | BigShuang/python-introductory-exercises | 9b8d391ce5fcbd12a654aba1c62a746ddb52a42d | [
"MIT"
] | null | null | null | s = input()
m, n = s.split(" ")
m = int(m)
n = int(n)
for ri in range(m):
for ci in range(n):
v = ( ri + 1 ) * ( ci + 1 )
print(v, end=" ")
print()
| 14.5 | 35 | 0.408046 | s = input()
m, n = s.split(" ")
m = int(m)
n = int(n)
for ri in range(m):
for ci in range(n):
v = ( ri + 1 ) * ( ci + 1 )
print(v, end=" ")
print()
| 0 | 0 | 0 |
89e422283e506acfd5a5dd572513aa47e2b556aa | 1,312 | py | Python | Code/Python/PossiblePlate.py | sgino209/LPR | 75da71796484f2b72e6f9626dc83fa7ec5103ba9 | [
"Apache-2.0"
] | null | null | null | Code/Python/PossiblePlate.py | sgino209/LPR | 75da71796484f2b72e6f9626dc83fa7ec5103ba9 | [
"Apache-2.0"
] | null | null | null | Code/Python/PossiblePlate.py | sgino209/LPR | 75da71796484f2b72e6f9626dc83fa7ec5103ba9 | [
"Apache-2.0"
] | 1 | 2021-01-27T12:28:14.000Z | 2021-01-27T12:28:14.000Z | # !/usr/bin/python
# _ _ ____ _ _ ____ _ _ _
# | | (_) ___ ___ _ __ ___ ___ | _ \| | __ _| |_ ___ | _ \ ___ ___ ___ __ _ _ __ (_) |_(_) ___ _ __
# | | | |/ __/ _ \ '_ \/ __|/ _ \ | |_) | |/ _` | __/ _ \ | |_) / _ \/ __/ _ \ / _` | ... | 52.48 | 113 | 0.348323 | # !/usr/bin/python
# _ _ ____ _ _ ____ _ _ _
# | | (_) ___ ___ _ __ ___ ___ | _ \| | __ _| |_ ___ | _ \ ___ ___ ___ __ _ _ __ (_) |_(_) ___ _ __
# | | | |/ __/ _ \ '_ \/ __|/ _ \ | |_) | |/ _` | __/ _ \ | |_) / _ \/ __/ _ \ / _` | ... | 0 | 0 | 0 |