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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4324db8515cebfc5a4b074a80e38c41a97a43e50 | 6,396 | py | Python | ratings/forms/widgets.py | Nuevosmedios/django-generic-ratings | 9e03f8a37ecb0c64e1f0cbba0a9df466126dff22 | [
"MIT"
] | null | null | null | ratings/forms/widgets.py | Nuevosmedios/django-generic-ratings | 9e03f8a37ecb0c64e1f0cbba0a9df466126dff22 | [
"MIT"
] | null | null | null | ratings/forms/widgets.py | Nuevosmedios/django-generic-ratings | 9e03f8a37ecb0c64e1f0cbba0a9df466126dff22 | [
"MIT"
] | null | null | null | from decimal import Decimal
from django import forms
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
class BaseWidget(forms.TextInput):
"""
Base widget. Do not use this directly.
"""
template = None
instance = None
class SliderWidget(BaseWidg... | 36.971098 | 109 | 0.613508 | from decimal import Decimal
from django import forms
from django.template.loader import render_to_string
from django.template.defaultfilters import slugify
class BaseWidget(forms.TextInput):
"""
Base widget. Do not use this directly.
"""
template = None
instance = None
def get_parent_id(self,... | 3,698 | 0 | 242 |
4861ebbaa0bdbe504fad249efcbe04c8dded3b16 | 3,882 | py | Python | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null | a1-supervised-learning/decision_tree.py | changrybirds/ml-2019fall | 1097530cdfa378c3c69d0ff5a3f95f9d8959cce4 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
import matplotlib.pyplot as plt
import dataset_processing as data_proc
if __name__ == "__main__":
abalone(verbose=False, show_plots=False)
online_shopping(verbose=Fal... | 31.306452 | 100 | 0.679547 | import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import cross_val_score
import matplotlib.pyplot as plt
import dataset_processing as data_proc
def model_complexity_curve(X_train, y_train, hp, hp_vals, cv=None):
df = pd.DataFrame(index=hp_vals, co... | 3,448 | 0 | 92 |
bc6fe1c7e25e8e6fad2daceba284a8044930c8c3 | 7,347 | py | Python | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/MY-PROCESS-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module MY-PROCESS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MY-PROCESS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 109.656716 | 1,073 | 0.755138 | #
# PySNMP MIB module MY-PROCESS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MY-PROCESS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 0 | 117 | 22 |
8f5f8c1e792333da6b38cc2cd4606e00cf00f23c | 19,153 | py | Python | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | openforcefield/typing/engines/smirnoff/forcefield_utils.py | pschmidtke/openforcefield | d0868c78a8dff9df6750c5212fa918d7dc0e7bd8 | [
"MIT"
] | null | null | null | #!/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
forcefield_utils.py
Utilities relating to OpenMM ForceField replacement using SMIRKS-b... | 40.407173 | 313 | 0.661567 | #!/bin/env python
#=============================================================================================
# MODULE DOCSTRING
#=============================================================================================
"""
forcefield_utils.py
Utilities relating to OpenMM ForceField replacement using SMIRKS-b... | 0 | 0 | 0 |
45dcabbf64ec5140e782fbc10fcddaccf3c13f9e | 30,301 | py | Python | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 15 | 2019-11-07T09:57:56.000Z | 2022-01-03T22:45:28.000Z | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 6 | 2021-03-19T23:15:14.000Z | 2021-09-23T16:46:19.000Z | util.py | ourresearch/jump-api | 5252da53656389f9bd53811929d5156ff8f7620c | [
"MIT"
] | 1 | 2021-12-17T05:50:47.000Z | 2021-12-17T05:50:47.000Z | # coding: utf-8
import bisect
import codecs
import collections
import datetime
import locale
import logging
import math
import os
import re
import tempfile
import time
import traceback
import unicodedata
import urllib.parse
from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE
import char... | 30.030723 | 145 | 0.624171 | # coding: utf-8
import bisect
import codecs
import collections
import datetime
import locale
import logging
import math
import os
import re
import tempfile
import time
import traceback
import unicodedata
import urllib.parse
from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE
import char... | 23,771 | 352 | 1,821 |
d8720d7f22de0deb1bb68bd9101b2c62c779b225 | 3,173 | py | Python | rosys/pathplanning/obstacle_map.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | 1 | 2022-02-20T08:21:07.000Z | 2022-02-20T08:21:07.000Z | rosys/pathplanning/obstacle_map.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | 1 | 2022-03-08T12:46:09.000Z | 2022-03-08T12:46:09.000Z | rosys/pathplanning/obstacle_map.py | zauberzeug/rosys | 10271c88ffd5dcc4fb8eec93d46fe4144a9e40d8 | [
"MIT"
] | null | null | null | import numpy as np
from scipy import ndimage
import cv2
from ..world.world import World
from .binary_renderer import BinaryRenderer
from .grid import Grid
from .robot_renderer import RobotRenderer
| 41.75 | 103 | 0.622754 | import numpy as np
from scipy import ndimage
import cv2
from ..world.world import World
from .binary_renderer import BinaryRenderer
from .grid import Grid
from .robot_renderer import RobotRenderer
class ObstacleMap:
def __init__(self, grid, map_, robot_renderer):
self.grid = grid
self.map = map_
... | 2,644 | 308 | 23 |
d13dc9b857e96a7e9d8ab8282640f8d59ecf3e70 | 415 | py | Python | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null | trik/trik.py | Zeyu-Li/kattis_solutions | 1599725facc32945f62acc9a5c3982d5834ba9ba | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 18.043478 | 35 | 0.375904 | def main():
counts = input()
a = [1,0,0]
for char in counts:
if char == 'A':
a[0], a[1] = a[1], a[0]
elif char == 'B':
a[1], a[2] = a[2], a[1]
else:
a[0], a[2] = a[2], a[0]
# print(a)
for index, i in enumerate(a):
if i == 1:
... | 354 | 0 | 22 |
b17485bf75669c3ce0838b5ddff2c0e6f5259d55 | 1,140 | py | Python | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | null | null | null | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | 21 | 2021-03-02T10:50:50.000Z | 2021-09-29T12:55:29.000Z | server/app/views/index.py | TrafficStuck/ts-server | 6d4f197d6f8542b85133dbb3cbfb3738a1caaeb5 | [
"MIT"
] | null | null | null | """This module provides basic server endpoints."""
from http import HTTPStatus
from flask import Blueprint, request
from app.utils.misc import make_response
internal_blueprint = Blueprint('traffic-stuck-internal', __name__)
@internal_blueprint.route("/health", methods=['GET'])
def get_health():
"""Return hea... | 25.909091 | 112 | 0.676316 | """This module provides basic server endpoints."""
from http import HTTPStatus
from flask import Blueprint, request
from app.utils.misc import make_response
internal_blueprint = Blueprint('traffic-stuck-internal', __name__)
@internal_blueprint.route("/health", methods=['GET'])
def get_health():
"""Return hea... | 0 | 0 | 0 |
a2198a5c61777794140e87db46e40df1259fb8da | 7,397 | py | Python | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 13 | 2022-03-09T15:27:29.000Z | 2022-03-29T06:12:47.000Z | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 7 | 2022-03-14T08:59:39.000Z | 2022-03-30T00:50:40.000Z | client/starwhale/utils/config.py | star-whale/starwhale | 11cfe86d3a0c2972b508812d101f1b32e4166706 | [
"Apache-2.0"
] | 9 | 2022-03-10T08:12:44.000Z | 2022-03-26T15:00:13.000Z | import os
import typing as t
import getpass
from pathlib import Path
import yaml
from starwhale.consts import (
UserRoleType,
SW_CLI_CONFIG,
DEFAULT_PROJECT,
DEFAULT_INSTANCE,
SW_LOCAL_STORAGE,
ENV_SW_CLI_CONFIG,
STANDALONE_INSTANCE,
LOCAL_CONFIG_VERSION,
)
from starwhale.utils.error i... | 30.566116 | 128 | 0.615925 | import os
import typing as t
import getpass
from pathlib import Path
import yaml
from starwhale.consts import (
UserRoleType,
SW_CLI_CONFIG,
DEFAULT_PROJECT,
DEFAULT_INSTANCE,
SW_LOCAL_STORAGE,
ENV_SW_CLI_CONFIG,
STANDALONE_INSTANCE,
LOCAL_CONFIG_VERSION,
)
from starwhale.utils.error i... | 6,005 | 690 | 137 |
e9c3e27af9aa4a410f686d7b95c805d8ffce192d | 126 | py | Python | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null | Euler1-5/euler3.py | jokkebk/livecoding | b925c5d8d30f5186c6f4c83a44e5704ceb92be48 | [
"MIT"
] | null | null | null | import math
n, i = 600851475143, 2
while n > 1:
if n % i == 0:
print(i)
n /= i
else:
i += 1
| 11.454545 | 22 | 0.404762 | import math
n, i = 600851475143, 2
while n > 1:
if n % i == 0:
print(i)
n /= i
else:
i += 1
| 0 | 0 | 0 |
5def1f05872b830bf36955bb002ba0e01e02e1a2 | 4,658 | py | Python | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | 1 | 2020-12-08T23:25:23.000Z | 2020-12-08T23:25:23.000Z | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | null | null | null | 2020/day-15/process.py | MatthieuMichon/advent-of-code | 2749d92de71d544a1b993577e300ee2026cecc94 | [
"MIT"
] | 1 | 2021-02-22T09:50:07.000Z | 2021-02-22T09:50:07.000Z | #!/usr/bin/env python
"""
Advent of Code 2020: Day 15
"""
import os
import re
import signal
import sys
from types import FrameType
from typing import List, Mapping
from pathlib import Path
DEBUG = False
def spoken_number(starting_numbers: List[int], turns: int) -> int:
"""
Compute spoken number after a giv... | 26.316384 | 107 | 0.636539 | #!/usr/bin/env python
"""
Advent of Code 2020: Day 15
"""
import os
import re
import signal
import sys
from types import FrameType
from typing import List, Mapping
from pathlib import Path
DEBUG = False
def spoken_number(starting_numbers: List[int], turns: int) -> int:
"""
Compute spoken number after a giv... | 0 | 0 | 0 |
fc96884381cb5606db13bce409311eb8c43b7e72 | 823 | py | Python | src/web/modules/smartq/admin.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 5 | 2018-03-08T17:22:27.000Z | 2018-03-11T14:20:53.000Z | src/web/modules/smartq/admin.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 263 | 2018-03-08T18:05:12.000Z | 2022-03-11T23:26:20.000Z | src/web/modules/smartq/admin.py | fossabot/SIStema | 1427dda2082688a9482c117d0e24ad380fdc26a6 | [
"MIT"
] | 6 | 2018-03-12T19:48:19.000Z | 2022-01-14T04:58:52.000Z | from django.contrib import admin
import users.admin
from modules.smartq import models
@admin.register(models.Question)
@admin.register(models.GeneratedQuestion)
@admin.register(models.StaffGeneratedQuestion)
| 21.102564 | 51 | 0.648846 | from django.contrib import admin
import users.admin
from modules.smartq import models
@admin.register(models.Question)
class QuestionAdmin(admin.ModelAdmin):
list_display = (
'short_name',
'created_date',
'modified_date',
)
search_fields = ('=id', 'short_name')
@admin.register(m... | 0 | 566 | 44 |
188af2b09335bf525da1e101ccdddb4de53fc716 | 4,602 | py | Python | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 1 | 2019-02-26T21:39:10.000Z | 2019-02-26T21:39:10.000Z | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 11 | 2020-06-05T20:02:33.000Z | 2022-02-26T09:55:09.000Z | yangram/conversations/views.py | LuceteYang/yangram | 922c4924c06043d5d27410611f4a76904452d44e | [
"MIT"
] | 1 | 2020-05-05T18:37:11.000Z | 2020-05-05T18:37:11.000Z | from django.shortcuts import render
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from yangram.conversations.models import *
from django.http import JsonResponse
from . import constants, sqls, serializers
from rest_framework import status
from django.shortcuts import get_... | 46.02 | 147 | 0.779009 | from django.shortcuts import render
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from yangram.conversations.models import *
from django.http import JsonResponse
from . import constants, sqls, serializers
from rest_framework import status
from django.shortcuts import get_... | 3,888 | 0 | 88 |
24791f571ad3e592f184b1d470e2aeeb137bb64a | 948 | py | Python | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | 1 | 2020-10-13T11:55:48.000Z | 2020-10-13T11:55:48.000Z | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | null | null | null | BuildingCyberLexicon/spiders/twitter/TweetScraper/scrapeTwitter.py | eneyi/CyberLexicon | b5d3e0245675fd692eae4a98df5d0c85604cfaba | [
"MIT"
] | 1 | 2020-10-13T11:56:04.000Z | 2020-10-13T11:56:04.000Z | import os
from time import sleep
import json
#use hastags and mentions from cyber war news articles as filters on twitter
if __name__ == "__main__":
hashtags = getMentionsAndHashtags()
for hashtag in hashtags:
outfile = "../../../outputfiles/twitter/"+str(hashtag).replace("#","").replace("@","")+".j... | 36.461538 | 127 | 0.594937 | import os
from time import sleep
import json
#use hastags and mentions from cyber war news articles as filters on twitter
def getMentionsAndHashtags():
with open("../../../outputfiles/cwn.json", "r+") as ff:
data = ff.read()
hashtagsMentions, data =[], json.loads(data)
for dd in data:
... | 408 | 0 | 22 |
3cb2f495379fa87b1682362e4c498ac0e66b256e | 590 | py | Python | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | jira.py | 317brian/rando-scripts | ae50080563f8a23783a2806735f508fe0a3bcea2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# You can create the script manually or clone the script and use it script via a symlink:
# For example `ln -s /Users/brian/rando-scripts/jira.py /usr/local/bin/jira`
# Make sure you create an environment variable named JIRA_URL for your terminal, such as .zshenv. Set the env variable equal to h... | 32.777778 | 157 | 0.740678 | #!/usr/bin/env python3
# You can create the script manually or clone the script and use it script via a symlink:
# For example `ln -s /Users/brian/rando-scripts/jira.py /usr/local/bin/jira`
# Make sure you create an environment variable named JIRA_URL for your terminal, such as .zshenv. Set the env variable equal to h... | 0 | 0 | 0 |
53a43e6290b908719c9b324da356c61fb8a8fb1c | 1,159 | py | Python | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | ps/samsung/treetech.py | underflow101/code-example | 1010a7ec6f8b5bf3ef5dbfad2ba075fd785b0cb0 | [
"MIT"
] | null | null | null | # treetech.py
# boj 16235
from sys import stdin
# input = stdin.readline
dx = (-1, -1, -1, 0, 0, 1, 1, 1)
dy = (-1, 0, 1, -1, 1, -1, 0, 1)
n, m, k = map(int, input().split())
mp = [[5] * n for _ in range(n)]
fert = [list(map(int, input().split())) for _ in range(n)]
tree = list()
for _ in range(m):
_x, _y, _z =... | 25.195652 | 71 | 0.459879 | # treetech.py
# boj 16235
from sys import stdin
# input = stdin.readline
dx = (-1, -1, -1, 0, 0, 1, 1, 1)
dy = (-1, 0, 1, -1, 1, -1, 0, 1)
n, m, k = map(int, input().split())
mp = [[5] * n for _ in range(n)]
fert = [list(map(int, input().split())) for _ in range(n)]
tree = list()
for _ in range(m):
_x, _y, _z =... | 0 | 0 | 0 |
033588472b7ed9ca2ebefa85133c4bef6d8f9b05 | 99 | py | Python | secondProject/driveTest/driveManager/apps.py | loic9654/Djangodev | 2babb235d68f508c64171a146be8483009dea7f7 | [
"Apache-2.0"
] | null | null | null | secondProject/driveTest/driveManager/apps.py | loic9654/Djangodev | 2babb235d68f508c64171a146be8483009dea7f7 | [
"Apache-2.0"
] | null | null | null | secondProject/driveTest/driveManager/apps.py | loic9654/Djangodev | 2babb235d68f508c64171a146be8483009dea7f7 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
| 16.5 | 36 | 0.777778 | from django.apps import AppConfig
class DrivemanagerConfig(AppConfig):
name = 'driveManager'
| 0 | 41 | 23 |
fbf7afe96ab301b5ab9ef4b0a41511d602b18303 | 1,502 | py | Python | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | 2 | 2021-10-17T04:39:50.000Z | 2022-01-10T12:35:25.000Z | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | checker/constants.py | OrphicHymns/Monolith | cacc453945f8d6209cc40d54f7212e7555898c86 | [
"MIT"
] | null | null | null | MOJANG_AUTH = "https://authserver.mojang.com/authenticate"
JSON_POST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.164 Safari/537.36 "
}
HTTP_HEADERS = {
"Upgrade-... | 42.914286 | 102 | 0.310919 | MOJANG_AUTH = "https://authserver.mojang.com/authenticate"
JSON_POST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.0.4472.164 Safari/537.36 "
}
HTTP_HEADERS = {
"Upgrade-... | 0 | 0 | 0 |
4ff1fa100f6d7beea43b3e70fc84a6e50a168c19 | 3,811 | py | Python | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | 3 | 2015-01-27T12:52:34.000Z | 2020-04-24T16:24:07.000Z | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | null | null | null | django_usda/management/commands/import_r27.py | alexBLR/django-usda | e9b6a63da5e1dddb347e0c8f965b3d1d8f6ae55e | [
"MIT"
] | 3 | 2015-07-03T14:24:30.000Z | 2020-04-25T00:43:40.000Z | from django.core.management.base import BaseCommand, CommandError
from django.db.models.loading import get_model
from django_usda.models import Food, FoodGroup, FoodLanguaLFactor, LanguaLFactor, NutrientData, Nutrient, Source, Derivation, Weight, Footnote, DataLink, DataSource, DeletedFood, DeletedNutrient, DeletedFoot... | 33.725664 | 211 | 0.609027 | from django.core.management.base import BaseCommand, CommandError
from django.db.models.loading import get_model
from django_usda.models import Food, FoodGroup, FoodLanguaLFactor, LanguaLFactor, NutrientData, Nutrient, Source, Derivation, Weight, Footnote, DataLink, DataSource, DeletedFood, DeletedNutrient, DeletedFoot... | 2,397 | 120 | 161 |
d199bc3cf4c227e15be15f7274aef821de06b5f4 | 2,518 | py | Python | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 35 | 2018-02-16T12:39:33.000Z | 2022-03-24T12:18:36.000Z | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 300 | 2018-02-16T12:24:32.000Z | 2022-03-31T13:41:36.000Z | vermouth/tests/helper_functions.py | biomolsim/vermouth-martinize | 332295078bfea680da7f488d2a9d61a97b8c9ae9 | [
"Apache-2.0"
] | 25 | 2018-11-07T18:52:07.000Z | 2022-03-06T08:34:38.000Z | # Copyright 2018 University of Groningen
#
# 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 i... | 31.08642 | 95 | 0.662033 | # Copyright 2018 University of Groningen
#
# 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 i... | 0 | 0 | 0 |
22d81486520b473e33b27fff2cfa30651a6f94c5 | 4,123 | py | Python | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | 1 | 2016-05-26T19:37:19.000Z | 2016-05-26T19:37:19.000Z | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | null | null | null | mne/selection.py | ARudiuk/mne-python | 63feb683cd1f8ddd598a78d12c8ef522f9ca2d78 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from os import path
from .io.meas_info import Info
from . import pick_types
from .utils import logger, verbos... | 35.239316 | 79 | 0.583071 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from os import path
from .io.meas_info import Info
from . import pick_types
from .utils import logger, verbos... | 0 | 0 | 0 |
6c3bad3d96508cbe3f4195973059baf235ed402d | 1,364 | py | Python | apply_fortran_template.py | elmanuelito/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | 4 | 2015-11-27T11:13:57.000Z | 2018-05-08T09:01:15.000Z | apply_fortran_template.py | ebranlard/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | null | null | null | apply_fortran_template.py | ebranlard/simple-fortran-parser | 42138901870fa4359bc650049f232ca3720fb01a | [
"MIT"
] | 1 | 2018-08-03T22:02:34.000Z | 2018-08-03T22:02:34.000Z | #!/usr/bin/env python
# --------------------------------------------------------------------------------
# --- PARAMS
# --------------------------------------------------------------------------------
Types=['integer','double precision','real','logical']
Dims =[1,0]
# --------------------------------------------... | 23.118644 | 82 | 0.34824 | #!/usr/bin/env python
# --------------------------------------------------------------------------------
# --- PARAMS
# --------------------------------------------------------------------------------
Types=['integer','double precision','real','logical']
Dims =[1,0]
# --------------------------------------------... | 0 | 0 | 0 |
77af3cb16b13c36bc1b49ee6c1ee34789921a428 | 3,376 | py | Python | misc_functions/__init__.py | MrJeremyHobbs/Book-Be-Gone | 017926c1ef0956baec8ffcfa85bbfd33430c9bb7 | [
"MIT"
] | 8 | 2019-04-08T16:24:11.000Z | 2021-04-08T18:05:27.000Z | misc_functions/__init__.py | MrJeremyHobbs/Book-Be-Gone | 017926c1ef0956baec8ffcfa85bbfd33430c9bb7 | [
"MIT"
] | 2 | 2019-04-11T19:26:05.000Z | 2019-10-24T15:24:37.000Z | misc_functions/__init__.py | MrJeremyHobbs/Book-Be-Gone | 017926c1ef0956baec8ffcfa85bbfd33430c9bb7 | [
"MIT"
] | 1 | 2019-04-08T16:24:17.000Z | 2019-04-08T16:24:17.000Z | import grequests
import requests | 38.363636 | 102 | 0.650474 | import grequests
import requests
def get_xmls(urls):
rs = (grequests.get(u) for u in urls)
r = grequests.map(rs)
r_array = []
for x in r:
print(x.status_code)
r_array.append(x)
return r_array
def check_bibs_api_GET(apikey):
url = f'https://api-na.hosted.exlibrisgr... | 3,140 | 0 | 204 |
d48cafa96ed56253b58bb41919d2655791e02dea | 281 | py | Python | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | null | null | null | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | 4 | 2020-04-06T14:20:58.000Z | 2020-04-17T10:47:11.000Z | dummy_device/register_classes.py | fretchen/synqs_devices | ec4bb24639e9d0d4cb707e1c2a6296a47dfe9f02 | [
"MIT"
] | 2 | 2020-04-10T08:56:28.000Z | 2020-09-06T20:08:29.000Z | """Register the YunTemp to blacs.
This is boilerplate and should be only minimally changed.
"""
from labscript_devices import register_classes
register_classes(
"DummyDevice",
BLACS_tab="user_devices.dummy_device.blacs_tabs.DummyDeviceTab",
runviewer_parser=None,
)
| 21.615385 | 68 | 0.782918 | """Register the YunTemp to blacs.
This is boilerplate and should be only minimally changed.
"""
from labscript_devices import register_classes
register_classes(
"DummyDevice",
BLACS_tab="user_devices.dummy_device.blacs_tabs.DummyDeviceTab",
runviewer_parser=None,
)
| 0 | 0 | 0 |
33ea139d5c0bdc9ba532bf85b6a211c71b4ae8a2 | 790 | py | Python | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | 1 | 2020-08-12T03:52:50.000Z | 2020-08-12T03:52:50.000Z | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | null | null | null | aplpy/conftest.py | senchp/aplpy | 0081433f8d061073c2f19980d371a8ae76994ea9 | [
"MIT"
] | null | null | null | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
from astropy.tests.pytest_plugins import *
from astropy.tests.pytest_plugins import pytest_addoption as astropy_pytest... | 34.347826 | 112 | 0.805063 | # this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
from astropy.tests.pytest_plugins import *
from astropy.tests.pytest_plugins import pytest_addoption as astropy_pytest... | 228 | 0 | 45 |
732ad0dfe6e7089832beb01c637675ca162227f6 | 2,231 | py | Python | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | graphql_compiler/tests/integration_tests/integration_backend_config.py | justinaustin/graphql-compiler | 4e68d592fc97855ca043dc20bdf59be4298647ab | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-present Kensho Technologies, LLC.
from collections import namedtuple
from six.moves.urllib.parse import quote_plus
from .. import test_backend
DEFAULT_ROOT_PASSWORD = "root" # nosec
SQL_BACKENDS = {
test_backend.POSTGRES,
test_backend.MYSQL,
test_backend.MARIADB,
test_backend.MSSQ... | 29.355263 | 99 | 0.693411 | # Copyright 2018-present Kensho Technologies, LLC.
from collections import namedtuple
from six.moves.urllib.parse import quote_plus
from .. import test_backend
DEFAULT_ROOT_PASSWORD = "root" # nosec
SQL_BACKENDS = {
test_backend.POSTGRES,
test_backend.MYSQL,
test_backend.MARIADB,
test_backend.MSSQ... | 0 | 0 | 0 |
e46d6e052ef66211c37cef5353eef69458461d60 | 7,203 | py | Python | pymeda/datasets.py | karunkannan/pymeda | 936e0e326274de121a3f65baa0db0ff14a6c1b05 | [
"Apache-2.0"
] | null | null | null | pymeda/datasets.py | karunkannan/pymeda | 936e0e326274de121a3f65baa0db0ff14a6c1b05 | [
"Apache-2.0"
] | 6 | 2019-02-10T19:30:10.000Z | 2019-03-26T02:23:01.000Z | pymeda/datasets.py | karunkannan/pymeda | 936e0e326274de121a3f65baa0db0ff14a6c1b05 | [
"Apache-2.0"
] | 3 | 2019-02-10T19:46:14.000Z | 2019-03-03T21:07:42.000Z | import os
import json
import statistics
import pandas as pd
import numpy as np
class CSVDataSet(DataSet):
""" A dataset living locally in a .csv file
"""
def getResource(self, index):
"""Get a specific data point from the data set.
Parameters
----------
index : int or... | 30.914163 | 86 | 0.539914 | import os
import json
import statistics
import pandas as pd
import numpy as np
class DataSet:
def __init__(self, D, name="default"):
self.D = D
self.n, self.d = self.D.shape
self.name = name
def getResource(self, index):
return self.D.iloc[index, :]
def saveMetaData(self... | 4,336 | -7 | 261 |
c93929021bb8364e7a04b30ef4c2a4414b855d18 | 188 | py | Python | src/handlers/mainhandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | src/handlers/mainhandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | src/handlers/mainhandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | import webapp2
class MainHandler(webapp2.RequestHandler):
"""Main Handler for the blog"""
def get(self):
"""Redirects to the blog page"""
self.redirect("/blog")
| 18.8 | 42 | 0.632979 | import webapp2
class MainHandler(webapp2.RequestHandler):
"""Main Handler for the blog"""
def get(self):
"""Redirects to the blog page"""
self.redirect("/blog")
| 0 | 0 | 0 |
afdb93fa4c7ac873a40c11acab097ed744cca020 | 16,779 | py | Python | hole_filling/components.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | 2 | 2020-04-14T07:51:02.000Z | 2022-03-25T08:09:04.000Z | hole_filling/components.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | null | null | null | hole_filling/components.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | 3 | 2020-04-10T08:33:11.000Z | 2020-05-19T06:51:23.000Z |
import os
import time
import numpy as np
from numba import jit, types
from numba.typed import Dict
from blockbased_synapseaware.hole_filling.connected_components.cc3d import connected_components
from blockbased_synapseaware.utilities.dataIO import PickleData, PickleNumbaData, WriteH5File
from blockbased_synap... | 44.271768 | 178 | 0.650396 |
import os
import time
import numpy as np
from numba import jit, types
from numba.typed import Dict
from blockbased_synapseaware.hole_filling.connected_components.cc3d import connected_components
from blockbased_synapseaware.utilities.dataIO import PickleData, PickleNumbaData, WriteH5File
from blockbased_synap... | 16,252 | 0 | 137 |
517ccb527d0a92db701ebf0e219f5fcbbb838e0e | 1,413 | py | Python | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 2 | 2015-06-09T16:07:09.000Z | 2015-07-28T10:06:31.000Z | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | 3 | 2020-07-22T15:14:55.000Z | 2021-12-13T19:35:06.000Z | examples/service/arg_check_example.py | ooici/pyon | 122c629290d27f32f2f41dafd5c12469295e8acf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''
@author Luke Campbel <LCampbell@ASAScience.com>
@file
@date 03/27/12 15:30
@description DESCRIPTION
'''
from pyon.util.arg_check import validate_is_instance, validate_in, validate_equal, validate_true
class ArgCheckService(object):
'''
Example Service illustrating how to use the var... | 27.173077 | 96 | 0.604388 | #!/usr/bin/env python
'''
@author Luke Campbel <LCampbell@ASAScience.com>
@file
@date 03/27/12 15:30
@description DESCRIPTION
'''
from pyon.util.arg_check import validate_is_instance, validate_in, validate_equal, validate_true
class ArgCheckService(object):
'''
Example Service illustrating how to use the var... | 11 | 0 | 26 |
85fd80dee75de489ab2b78464c3cbc65eeca1519 | 1,913 | py | Python | annotated_packet.py | USC-NSL/policing-detection | 95dcfbd76875b23e26a57f1a5f4b82ea63916c99 | [
"Apache-2.0"
] | 13 | 2016-12-12T02:19:49.000Z | 2021-12-08T12:49:28.000Z | annotated_packet.py | USC-NSL/policing-detection | 95dcfbd76875b23e26a57f1a5f4b82ea63916c99 | [
"Apache-2.0"
] | null | null | null | annotated_packet.py | USC-NSL/policing-detection | 95dcfbd76875b23e26a57f1a5f4b82ea63916c99 | [
"Apache-2.0"
] | 3 | 2017-10-18T08:01:12.000Z | 2018-05-22T08:46:32.000Z | import dpkt
from dpkt.tcp import *
from tcp_util import *
| 31.883333 | 78 | 0.637219 | import dpkt
from dpkt.tcp import *
from tcp_util import *
class AnnotatedPacket(object):
def __init__(self, packet, timestamp_us, index):
self.packet = packet
self.timestamp_us = timestamp_us
self.index = index
self.ack_delay_ms = -1
self.ack_index = -1
self.rtx ... | 1,023 | 807 | 23 |
61c5161b9f9bd6ce0d40bbd88906570121b82373 | 1,057 | py | Python | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | 1 | 2020-02-18T23:20:44.000Z | 2020-02-18T23:20:44.000Z | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | null | null | null | python_version/plateau.py | k3nnywilliam/rover-simulator | c250af46c838fab2dc20161bb1d8a3f6470f1045 | [
"MIT"
] | null | null | null | '''
Written by Kenny William Nyallau ©2020
This is a python implementation of Rover challenge
'''
| 26.425 | 82 | 0.525071 | '''
Written by Kenny William Nyallau ©2020
This is a python implementation of Rover challenge
'''
class Plateau:
def __init__(self):
self.px = 0
self.py = 0
self.x = 0
self.y = 0
self.name = ""
def setRoverCoordinates(self, x, y):
self.x = x
self.y = y
... | 834 | -7 | 130 |
166da20936646259d249f9f96026f0761b83bcf2 | 663 | py | Python | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | 5 | 2018-10-16T03:48:02.000Z | 2021-10-01T08:58:05.000Z | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | 1 | 2018-10-17T16:19:14.000Z | 2018-10-31T06:19:30.000Z | obsvail/tests/load_experts.py | sandipan1/robo_rl | 3bcb7caabeba71dd747fadf2355ac42408b7f340 | [
"MIT"
] | null | null | null | import pickle
experts_file_path = "../experts/sampled_experts.obs"
with open(experts_file_path, "rb") as f:
expert_trajectories = pickle.load(f)
# (num_experts)
print(len(expert_trajectories))
# (trajectory_length)
print(len(expert_trajectories[0]["trajectory"]))
# (num_observations, 1)
print(expert_trajectori... | 27.625 | 91 | 0.751131 | import pickle
experts_file_path = "../experts/sampled_experts.obs"
with open(experts_file_path, "rb") as f:
expert_trajectories = pickle.load(f)
# (num_experts)
print(len(expert_trajectories))
# (trajectory_length)
print(len(expert_trajectories[0]["trajectory"]))
# (num_observations, 1)
print(expert_trajectori... | 0 | 0 | 0 |
51132cf221eac7d2bc80d0b8468825911b58e7ae | 4,646 | py | Python | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 8 | 2019-05-24T19:31:38.000Z | 2019-05-28T14:13:56.000Z | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 17 | 2018-07-14T17:04:49.000Z | 2022-03-24T15:59:11.000Z | navio_tasks/commands/cli_pylint.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 2 | 2021-03-26T18:34:41.000Z | 2022-03-14T16:27:23.000Z | """
Lots of code gripes.
"""
import os
import shlex
import subprocess
import sys
from typing import List
from navio_tasks import settings as settings
from navio_tasks.cli_commands import check_command_exists, config_pythonpath
from navio_tasks.output import say_and_exit
from navio_tasks.pure_reports.cli_pygount import... | 31.605442 | 87 | 0.602238 | """
Lots of code gripes.
"""
import os
import shlex
import subprocess
import sys
from typing import List
from navio_tasks import settings as settings
from navio_tasks.cli_commands import check_command_exists, config_pythonpath
from navio_tasks.output import say_and_exit
from navio_tasks.pure_reports.cli_pygount import... | 0 | 0 | 0 |
27aae263b75fff183863589ccb93f7732b2a47d8 | 763 | py | Python | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | ckuser/config.py | ds19991999/CKUser | c66ebda6ef5068a79b816de2c57a443b25d7096d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
mysql> desc userinfors;
+----------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_incre... | 30.52 | 63 | 0.349934 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
mysql> desc userinfors;
+----------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_incre... | 152 | 0 | 23 |
4954a99b7dfa453ebb17638013bab490f8777570 | 9,920 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/macInMACNoFcs_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/macInMACNoFcs_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/macInMACNoFcs_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
| 36.740741 | 127 | 0.675403 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class MacInMACNoFcs(Base):
__slots__ = ()
_SDM_NAME = 'macInMACNoFcs'
_SDM_ATT_MAP = {
'HeaderBdestinationAddressEthernet': 'macInMACNoFcs.header.bdestinationAddressEthernet-1',
'HeaderBsourceAddressEthernet': ... | 150 | 9,666 | 23 |
12e25ddc4af0bf599e86ed3d6dcf5866baa2d81b | 1,436 | py | Python | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 3 | 2019-05-30T03:40:38.000Z | 2021-04-12T06:50:41.000Z | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | 1 | 2020-06-15T12:27:56.000Z | 2020-06-15T12:27:56.000Z | generate_computational_graph.py | TalkToTheGAN/RelaxTextGAN | 6d0846392c8a1267eaa103dd70492cb80024079e | [
"Apache-2.0"
] | null | null | null | import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from models.plain_lstm import PlainLSTM
from utils import Utils
from data_loader import DataLoader
import argpar... | 27.09434 | 76 | 0.727716 | import os
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from models.plain_lstm import PlainLSTM
from utils import Utils
from data_loader import DataLoader
import argpar... | 564 | 0 | 23 |
e5af07709463973f94d2c5f0008791ffee86f7e8 | 7,928 | py | Python | course_selection/scrape_parse.py | recalapp/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 13 | 2017-01-27T18:07:04.000Z | 2022-02-11T19:32:29.000Z | course_selection/scrape_parse.py | kl29/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 14 | 2017-01-08T22:28:49.000Z | 2020-02-05T03:08:08.000Z | course_selection/scrape_parse.py | kl29/recal | 1464d5922f3a1fcc0d756565a3a0e8689e9e154d | [
"MIT"
] | 5 | 2017-12-07T17:41:35.000Z | 2020-04-27T18:24:52.000Z | """
Scrapes OIT's Web Feeds to add courses and sections to database.
Procedure:
- Get list of departments (3-letter department codes)
- Run this: http://etcweb.princeton.edu/webfeeds/courseofferings/?term=current&subject=COS
- Parse it for courses, sections, and lecture times (as recurring events)
"""
from lxml impo... | 34.469565 | 97 | 0.577699 | """
Scrapes OIT's Web Feeds to add courses and sections to database.
Procedure:
- Get list of departments (3-letter department codes)
- Run this: http://etcweb.princeton.edu/webfeeds/courseofferings/?term=current&subject=COS
- Parse it for courses, sections, and lecture times (as recurring events)
"""
from lxml impo... | 7,417 | 7 | 100 |
f2ca13584c91841e3c1379b5d63aa670e6391478 | 757 | py | Python | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 191 | 2015-01-05T23:04:06.000Z | 2022-02-15T21:36:34.000Z | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 198 | 2015-01-01T06:27:33.000Z | 2021-02-23T16:39:28.000Z | kotti/views/file.py | IonicaBizauKitchen/Kotti | 8f2363a058c77d5d42adb2d12715e4d0530d5208 | [
"PostgreSQL"
] | 83 | 2015-01-12T14:29:48.000Z | 2022-02-13T09:41:36.000Z | from pyramid.view import view_config
from kotti.interfaces import IFile
@view_config(
name="view",
context=IFile,
permission="view",
renderer="kotti:templates/view/file.pt",
)
@view_config(name="inline-view", context=IFile, permission="view")
@view_config(name="attachment-view", context=IFile, pe... | 22.264706 | 70 | 0.726552 | from pyramid.view import view_config
from kotti.interfaces import IFile
@view_config(
name="view",
context=IFile,
permission="view",
renderer="kotti:templates/view/file.pt",
)
def view(context, request):
return {}
@view_config(name="inline-view", context=IFile, permission="view")
def inline_vie... | 176 | 0 | 66 |
3644fc77790a588e2cb4c844af28ad7dff6408a8 | 2,721 | py | Python | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T00:36:43.000Z | 2021-12-23T00:36:43.000Z | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | src/trusted/validator_mips/dgen/dgen_input.py | kapkic/native_client | 51c8bc8c249d55606232ae011bdfc8b4cab3d794 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple recursive-descent parser for the table file format.
The grammar implemented here is roughly (taking some liberties ... | 21.768 | 80 | 0.603087 | #!/usr/bin/python2
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple recursive-descent parser for the table file format.
The grammar implemented here is roughly (taking some liberties ... | 1,311 | 0 | 161 |
d830915f8e3e69a3330d6ff63d4fe215fdf4d734 | 1,254 | py | Python | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | null | null | null | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | 1 | 2022-02-10T00:37:26.000Z | 2022-02-10T00:37:26.000Z | app.py | wieczszy/CVsudoku | 2338d4ee8c75c556966022363d636143abd600c9 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import logging
from argparse import ArgumentParser
from src.classifier import Classifier
from src.reader import ImageReader
from src.solver import SudokuSolver
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("image", help="Input image")
parser.add_arg... | 29.162791 | 93 | 0.668262 | import cv2
import numpy as np
import logging
from argparse import ArgumentParser
from src.classifier import Classifier
from src.reader import ImageReader
from src.solver import SudokuSolver
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("image", help="Input image")
parser.add_arg... | 0 | 0 | 0 |
e2abc012a866c8d1954bf677e77b2c3d1ef6d887 | 2,011 | py | Python | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | addressBook/tests.py | rahman-ishtiyak/Directory | f6f66aaa38e596da231c555cb18c53a0669f98a9 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.test import Client
# Create your tests here.
from django.conf import settings
from django.test import TestCase
from .models import *
"""
Data is not testing or returning 0 due to authentication. Turn off authentication to get proper result
we can use more test case as CR... | 32.967213 | 102 | 0.652909 | from django.test import TestCase
from django.test import Client
# Create your tests here.
from django.conf import settings
from django.test import TestCase
from .models import *
class TestModels(TestCase):
def test_model_str_country(self):
data = Country.objects.count()
self.assertEqual(data, 0)
... | 1,425 | 6 | 157 |
81c6e929131f5087231b8a102174208c5768f655 | 7,687 | py | Python | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 55 | 2015-07-29T12:06:34.000Z | 2018-03-17T05:42:01.000Z | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 11 | 2015-08-07T20:56:41.000Z | 2018-03-21T15:24:08.000Z | arviz/plots/backends/__init__.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 17 | 2015-07-29T13:55:01.000Z | 2018-03-02T17:16:12.000Z | # pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
__all__ = [
"to_cds",
"output_notebook",
"output_file",
"ColumnDataSource",
"create_layout",
"show_layout",
]... | 34.626126 | 98 | 0.619748 | # pylint: disable=no-member,invalid-name,redefined-outer-name
"""ArviZ plotting backends."""
import re
import numpy as np
from pandas import DataFrame
from ...rcparams import rcParams
__all__ = [
"to_cds",
"output_notebook",
"output_file",
"ColumnDataSource",
"create_layout",
"show_layout",
]... | 0 | 0 | 0 |
4038bdf4d214176cf5c3d3b92c8642280a111fe2 | 513 | py | Python | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | 6 | 2016-05-18T16:11:29.000Z | 2021-02-25T00:54:31.000Z | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | null | null | null | web/wsgi.py | apsun/VNaaS | d7f8c3c367068bc14778e7182a342ef1b6c0c634 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import vnaas
PORT = 8080
if __name__ == "__main__":
main()
| 20.52 | 54 | 0.653021 | #!/usr/bin/env python
import sys
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
import vnaas
PORT = 8080
def main():
if len(sys.argv) == 1:
port = PORT
elif len(sys.argv) == 2:
port = int(sys.argv[1])
else:
print("... | 276 | 0 | 23 |
3c3122c833af7f81253516b14e983bfae91fa68f | 266 | py | Python | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/First Steps in Coding/First Steps in Coding - Lab/06_concatenate_data/concatanate_date.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | first_name = input()
last_name = input()
age = int(input())
town = input()
concatanate_variables(first_name, last_name, age, town)
| 22.166667 | 77 | 0.703008 | first_name = input()
last_name = input()
age = int(input())
town = input()
def concatanate_variables(fn, ln, ages, place_town):
print(f"You are {fn} {ln}, a {ages}-years old person from {place_town}.")
concatanate_variables(first_name, last_name, age, town)
| 109 | 0 | 23 |
1c8ba93ca1af203359817567224495c00bb7482d | 1,258 | py | Python | or78_helpers.py | philjonas/oregon-trail-1978-python | c47efaa6b2a6e8898f1cd8f43ba7ce47b04c0045 | [
"MIT"
] | 4 | 2020-10-29T01:55:20.000Z | 2021-11-11T19:07:41.000Z | or78_helpers.py | philjonas/oregon-trail-1978-python | c47efaa6b2a6e8898f1cd8f43ba7ce47b04c0045 | [
"MIT"
] | null | null | null | or78_helpers.py | philjonas/oregon-trail-1978-python | c47efaa6b2a6e8898f1cd8f43ba7ce47b04c0045 | [
"MIT"
] | 1 | 2021-01-16T23:45:41.000Z | 2021-01-16T23:45:41.000Z | import random
import time
| 26.765957 | 62 | 0.629571 | import random
import time
def input_yes_no(message):
reply = input(message)
return True if 'y' in reply else False
def input_int(message):
text_2_int = None
while text_2_int == None:
try:
text_2_int = int(input(message))
except:
text_2_int = None
return te... | 1,136 | 0 | 92 |
30b872192e3b8c3c9605c77fdc5fa1954cca85e6 | 1,033 | py | Python | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | 1 | 2021-06-13T14:40:31.000Z | 2021-06-13T14:40:31.000Z | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | null | null | null | aiida_vasp/io/tests/test_outcar_io.py | chrisjsewell/aiida-vasp | 11b6abf728efdba475c2fa24ede41c4ffe8fac64 | [
"MIT"
] | null | null | null | """Test the OUTCAR io interface"""
# pylint: disable=unused-import,redefined-outer-name,unused-argument,unused-wildcard-import,wildcard-import
import pytest
from aiida_vasp.utils.fixtures import *
from aiida_vasp.utils.fixtures.testdata import data_path
from aiida_vasp.io.outcar import OutcarParser
def test_parse_o... | 41.32 | 107 | 0.734753 | """Test the OUTCAR io interface"""
# pylint: disable=unused-import,redefined-outer-name,unused-argument,unused-wildcard-import,wildcard-import
import pytest
from aiida_vasp.utils.fixtures import *
from aiida_vasp.utils.fixtures.testdata import data_path
from aiida_vasp.io.outcar import OutcarParser
def test_parse_o... | 0 | 0 | 0 |
78dfb0de46f72805031b6ac3304e2e0cb7627623 | 7,591 | py | Python | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | 20 | 2022-02-19T13:16:07.000Z | 2022-03-24T02:24:00.000Z | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | null | null | null | my_models/action_conv.py | Yifanfanfanfan/sifar-pytorch | 888a18414f7187a6fe7dddc2bf5deb9fa2700e63 | [
"Apache-2.0"
] | 5 | 2022-02-07T16:43:11.000Z | 2022-02-21T10:53:15.000Z | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch
import torch.nn as nn
from timm.models.layers import DropPa... | 39.536458 | 151 | 0.661178 | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch
import torch.nn as nn
from timm.models.layers import DropPa... | 3,719 | 0 | 251 |
09417823733242741dd9965f5c2ed1a6be80d9de | 1,455 | py | Python | backend/db/fields.py | the-lans/FastAPITemplate | 51c25622944b26fde545fec1824b2e334b020662 | [
"MIT"
] | 2 | 2021-08-15T09:07:21.000Z | 2021-08-15T21:03:37.000Z | backend/db/fields.py | the-lans/YaML | cded6010b800f9a0bf00e50f0a144d9b1fc85959 | [
"MIT"
] | null | null | null | backend/db/fields.py | the-lans/YaML | cded6010b800f9a0bf00e50f0a144d9b1fc85959 | [
"MIT"
] | 1 | 2021-08-15T21:03:40.000Z | 2021-08-15T21:03:40.000Z | from typing import Union, Iterable, Mapping, Any
import peewee
from backend.library.decorators.cache import unified
| 29.1 | 102 | 0.578007 | from typing import Union, Iterable, Mapping, Any
import peewee
from backend.library.decorators.cache import unified
class OptionsField(peewee.IntegerField):
def __init__(
self,
options: Union[Iterable, Mapping[int, Any]] = None,
*args,
first_i=0,
**kwargs,
):
i... | 1,134 | 180 | 23 |
aefa93d7bcd48c97f558b280687e6727b5aa6b07 | 1,276 | py | Python | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 28 | 2019-11-08T03:09:59.000Z | 2022-03-09T06:59:04.000Z | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | null | null | null | typing/crawl.py | zhuning1999/PythonCode | 8ca9aed385af64763c79a13f1bf9c5b67b0c8a63 | [
"MIT"
] | 50 | 2019-09-17T15:28:34.000Z | 2022-03-29T09:10:12.000Z | import time
import random
import requests
from lxml import etree
headers = {
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
if __name__ == "__main__":
crawl_main()
| 23.2 | 135 | 0.552508 | import time
import random
import requests
from lxml import etree
headers = {
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"
}
def is_chinese(word):
# 判断是不是中文
for ch in word:
if '\u4e00' <= ch <= '\u... | 945 | 0 | 100 |
0ee16d8c95d934e2d3c6b60aa7145bb28cff6d95 | 1,429 | py | Python | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | 1 | 2015-01-07T05:29:57.000Z | 2015-01-07T05:29:57.000Z | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | endtoend_tests/grep.py | pchaigno/grr | 69c81624c281216a45c4bb88a9d4e4b0613a3556 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""End to end tests for lib.flows.general.grep."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.rdfvalues import client as rdf_client
class TestSearchFiles(base.AutomatedTest):
"""Test SearchFileContent."""
platforms = ["Linux"]
flow = "SearchFileContent"
t... | 32.477273 | 74 | 0.6662 | #!/usr/bin/env python
"""End to end tests for lib.flows.general.grep."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib.rdfvalues import client as rdf_client
class TestSearchFiles(base.AutomatedTest):
"""Test SearchFileContent."""
platforms = ["Linux"]
flow = "SearchFileContent"
t... | 544 | 0 | 50 |
6f7d6c235f928d355357114c1a117ab955e5f493 | 298 | py | Python | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | core/apps/attendance/admin.py | yavuzbektas/StudentAnalayze | 794f433f650633f646bee5cbe08d04afdbd75e84 | [
"MIT"
] | null | null | null | from django.contrib import admin
# from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
# from django.contrib.auth.models import User
# Register your models here.
from .models import LessonPeriods,DailyAttendance
admin.site.register(LessonPeriods)
admin.site.register(DailyAttendance)
| 33.111111 | 66 | 0.83557 | from django.contrib import admin
# from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
# from django.contrib.auth.models import User
# Register your models here.
from .models import LessonPeriods,DailyAttendance
admin.site.register(LessonPeriods)
admin.site.register(DailyAttendance)
| 0 | 0 | 0 |
6e31c41793bea851900f354d8d475f0c33a394ce | 7,904 | py | Python | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | mobtexting_sms/models/send_sms.py | mobtexting/mobtexting-odoo | 01b1a6f87fc41b8c9f4099476d00023ff84b8372 | [
"MIT"
] | null | null | null | import logging
from odoo import http
from odoo.exceptions import except_orm, UserError, Warning
from odoo.http import request, serialize_exception as _serialize_exception, content_disposition
from odoo import api, fields, models, tools, _
import datetime
from urllib.parse import urlencode, quote as quote
import urllib.... | 42.042553 | 207 | 0.573001 | import logging
from odoo import http
from odoo.exceptions import except_orm, UserError, Warning
from odoo.http import request, serialize_exception as _serialize_exception, content_disposition
from odoo import api, fields, models, tools, _
import datetime
from urllib.parse import urlencode, quote as quote
import urllib.... | 4,270 | 2,114 | 22 |
5fe7c27af5807b5b054a2d1aaee39cfae6b4adb3 | 606 | py | Python | OpenSees/SRC/interpreter/test.py | kuanshi/ductile-fracture | ccb350564df54f5c5ec3a079100effe261b46650 | [
"MIT"
] | 8 | 2019-03-05T16:25:10.000Z | 2020-04-17T14:12:03.000Z | examples/test.py | ElsevierSoftwareX/SOFTX-D-17-00072 | b7aa03d0243dce5fa3c79e53a753ceb871926908 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/test.py | ElsevierSoftwareX/SOFTX-D-17-00072 | b7aa03d0243dce5fa3c79e53a753ceb871926908 | [
"BSD-2-Clause-FreeBSD"
] | 5 | 2018-02-26T09:38:24.000Z | 2020-11-26T15:38:56.000Z | import opensees as ops
ops.wipe()
ops.uniaxialMaterial("Elastic", 1, 1000.);
ops.testUniaxialMaterial(1);
for strain in [0.01, 0.02, 0.03, 0.04, 0.05]:
ops.setStrain(strain);
print("strain: ", str(ops.getStrain()), " stress: ", str(ops.getStress()), " tangent: ", str(ops.getTangent()));
ops.uniaxialMaterial... | 31.894737 | 116 | 0.650165 | import opensees as ops
ops.wipe()
ops.uniaxialMaterial("Elastic", 1, 1000.);
ops.testUniaxialMaterial(1);
for strain in [0.01, 0.02, 0.03, 0.04, 0.05]:
ops.setStrain(strain);
print("strain: ", str(ops.getStrain()), " stress: ", str(ops.getStress()), " tangent: ", str(ops.getTangent()));
ops.uniaxialMaterial... | 0 | 0 | 0 |
c7e6af834f54b88f53d67454458b733d57a12bf3 | 9,923 | py | Python | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | null | null | null | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | 1 | 2021-11-24T20:46:33.000Z | 2021-11-24T20:46:33.000Z | know/scrap/pieces.py | otosense/know | 1e0688dedb48335644464c6be35ca91afdb5b2e3 | [
"Apache-2.0"
] | null | null | null | """pieces of thing for inspiration
"""
import itertools
from dataclasses import dataclass
from itertools import takewhile as itertools_takewhile
from atypes import Slab
from creek import Creek
from creek.util import to_iterator
from i2 import MultiObj, FuncFanout, ContextFanout, Pipe
from typing import Callable, Iter... | 31.009375 | 89 | 0.620377 | """pieces of thing for inspiration
"""
import itertools
from dataclasses import dataclass
from itertools import takewhile as itertools_takewhile
from atypes import Slab
from creek import Creek
from creek.util import to_iterator
from i2 import MultiObj, FuncFanout, ContextFanout, Pipe
from typing import Callable, Iter... | 5,829 | 430 | 452 |
2ef422cadf4f6a9f51b16cd6259af716310db401 | 722 | py | Python | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | core/migrations/0015_auto_20210116_1202.py | Specialistik/my_internet | fedbc0266b2646f0ec19ea89ead7d0342ff79d81 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-16 09:02
import datetime
from django.db import migrations, models
| 28.88 | 134 | 0.619114 | # Generated by Django 3.1.4 on 2021-01-16 09:02
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0014_auto_20210116_1202'),
]
operations = [
migrations.AlterField(
model_name='payment',
nam... | 0 | 624 | 23 |
8773f63df6fbc10b6d52360a5354fbed727f45aa | 890 | py | Python | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | apps/vars/site_config.py | wizzzet/todo_backend | 58d27a639899514a3b10058cebb82c9b420a5bcc | [
"MIT"
] | null | null | null | import datetime
from snippets.utils.datetime import utcnow
from vars.models import SiteConfig
CACHE_TIMEOUT = datetime.timedelta(0, 30)
site_config = SiteConfigs()
| 22.25 | 63 | 0.626966 | import datetime
from snippets.utils.datetime import utcnow
from vars.models import SiteConfig
CACHE_TIMEOUT = datetime.timedelta(0, 30)
class SiteConfigs(object):
def __init__(self):
self.last_modified = None
self.configs = None
def index(self, force=False):
now = utcnow()
... | 558 | 5 | 157 |
0249338edf6fa8f543122d623322698d0e9205f4 | 16,213 | py | Python | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | 1 | 2016-08-19T18:58:51.000Z | 2016-08-19T18:58:51.000Z | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | null | null | null | plotting_functions.py | h-mayorquin/attractor_sequences | 885271f30d73a58a7aad83b55949e4e32ba0b45a | [
"MIT"
] | null | null | null | import seaborn as sns
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from data_transformer import transform_neural_to_normal
from analysis_functions import calculate_angle_from_history, calculate_winni... | 33.428866 | 120 | 0.645593 | import seaborn as sns
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
from data_transformer import transform_neural_to_normal
from analysis_functions import calculate_angle_from_history, calculate_winni... | 11,424 | 0 | 184 |
50637c98a7aa9839bc89e1671304eacf81cfdf18 | 10,818 | py | Python | rswarp/diagnostics/FieldDiagnostic.py | tanxicccc/rswarp | 3cead0d4e96c73caaae15e4376ac4637dc34c5dc | [
"Apache-2.0"
] | null | null | null | rswarp/diagnostics/FieldDiagnostic.py | tanxicccc/rswarp | 3cead0d4e96c73caaae15e4376ac4637dc34c5dc | [
"Apache-2.0"
] | null | null | null | rswarp/diagnostics/FieldDiagnostic.py | tanxicccc/rswarp | 3cead0d4e96c73caaae15e4376ac4637dc34c5dc | [
"Apache-2.0"
] | null | null | null | import os
import datetime
from dateutil.tz import tzlocal
import h5py as h5
import numpy as np
from warp import getselfe, getphi, getb, geta
class FieldDiagnostic(object):
"""
Common functionality for field diagnostic classes
Parameters:
solver: A solver object containing fields to b... | 38.498221 | 152 | 0.564615 | import os
import datetime
from dateutil.tz import tzlocal
import h5py as h5
import numpy as np
from warp import getselfe, getphi, getb, geta
class FieldDiagnostic(object):
"""
Common functionality for field diagnostic classes
Parameters:
solver: A solver object containing fields to b... | 8,591 | 0 | 242 |
12c890bdbd604a4966085d68d959b37602ac980f | 2,704 | py | Python | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | synapse/_scripts/export_signing_key.py | Fizzadar/synapse | 6b46c3eb3d526d903e1e4833b2e8ae9b73de8502 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 ... | 26.252427 | 86 | 0.60503 | #!/usr/bin/env python
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 ... | 1,746 | 0 | 92 |
13bb8da2ca5eeda7d756f842c47cc33eab784784 | 8,620 | py | Python | data_loader/data_loader.py | SigureMo/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 1 | 2020-04-06T05:37:03.000Z | 2020-04-06T05:37:03.000Z | data_loader/data_loader.py | cattidea/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 2 | 2019-12-16T23:43:38.000Z | 2020-02-01T07:01:39.000Z | data_loader/data_loader.py | cattidea/shoeprint-recognition | fe9288938827497c8b555f4fea98e96487943d44 | [
"MIT"
] | 1 | 2019-11-29T16:41:28.000Z | 2019-11-29T16:41:28.000Z | import os
import json
import h5py
import random
import numpy as np
from config_parser.config import PATHS, DEBUG
from data_loader.base import CacheLoader
from data_loader.image import image2array
H5_PATH = PATHS["h5_path"]
JSON_PATH = PATHS["json_path"]
SHOEPRINT_DIR = PATHS["shoeprint_dir"]
SAMPLE_DIR = PATHS["sampl... | 32.900763 | 103 | 0.594896 | import os
import json
import h5py
import random
import numpy as np
from config_parser.config import PATHS, DEBUG
from data_loader.base import CacheLoader
from data_loader.image import image2array
H5_PATH = PATHS["h5_path"]
JSON_PATH = PATHS["json_path"]
SHOEPRINT_DIR = PATHS["shoeprint_dir"]
SAMPLE_DIR = PATHS["sampl... | 0 | 0 | 0 |
a2e702854416df3867f7115a181a4fd224ad1bcc | 6,444 | py | Python | src/utils.py | annihilatorrrr/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 30 | 2022-01-17T20:46:02.000Z | 2022-03-31T18:49:07.000Z | src/utils.py | studasd/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 4 | 2022-02-13T10:21:12.000Z | 2022-03-28T16:05:51.000Z | src/utils.py | studasd/opentele | ff90c36a867cf7902e80f480a35041c5e7902e4c | [
"MIT"
] | 9 | 2022-01-24T18:02:08.000Z | 2022-03-24T14:23:16.000Z | from __future__ import annotations
from . import debug
from typing import Coroutine, Tuple, Type, Callable, TypeVar, Optional, List, Any, Dict
from types import FunctionType
import abc
APP_VERSION = 3004000
TDF_MAGIC = b"TDF$"
_T = TypeVar("_T")
_TCLS = TypeVar("_TCLS", bound=type)
_RT = TypeVar("_RT")
_F = TypeVa... | 30.980769 | 123 | 0.575109 | from __future__ import annotations
from . import debug
from typing import Coroutine, Tuple, Type, Callable, TypeVar, Optional, List, Any, Dict
from types import FunctionType
import abc
APP_VERSION = 3004000
TDF_MAGIC = b"TDF$"
_T = TypeVar("_T")
_TCLS = TypeVar("_TCLS", bound=type)
_RT = TypeVar("_RT")
_F = TypeVa... | 4,973 | 73 | 361 |
d06f09440a6a5fcdcc7fe798643dc77e8de50601 | 5,021 | py | Python | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 4 | 2020-04-08T03:42:02.000Z | 2020-10-01T20:34:48.000Z | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 93 | 2020-03-26T14:29:14.000Z | 2020-11-12T05:54:55.000Z | qa/tasks/cram.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 23 | 2020-03-24T10:28:44.000Z | 2020-09-24T09:42:19.000Z | """
Cram tests
"""
import logging
import os
import six
from tasks.util.workunit import get_refspec_after_overrides
from teuthology import misc as teuthology
from teuthology.parallel import parallel
from teuthology.orchestra import run
from teuthology.config import config as teuth_config
log = logging.getLogger(__na... | 33.032895 | 87 | 0.5238 | """
Cram tests
"""
import logging
import os
import six
from tasks.util.workunit import get_refspec_after_overrides
from teuthology import misc as teuthology
from teuthology.parallel import parallel
from teuthology.orchestra import run
from teuthology.config import config as teuth_config
log = logging.getLogger(__na... | 0 | 0 | 0 |
aa18e439d183a51bf3e6d04d8f0c183825d9ae89 | 4,211 | py | Python | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | codes/unique1_pairs_review.py | gordeli/JCR_LIARspaper | cd2eee016e0dfe36d9c947be9c1523cfa1badac2 | [
"MIT"
] | null | null | null | # This code calculates the number of unique words in each review:
# from pathos.multiprocessing import ProcessingPool as Pool
import multiprocessing
from multiprocessing.pool import Pool
from tqdm import tqdm
import time
# import timing
import re # import the library for regular expressions
from nltk.tokenize import ... | 35.686441 | 223 | 0.666588 | # This code calculates the number of unique words in each review:
# from pathos.multiprocessing import ProcessingPool as Pool
import multiprocessing
from multiprocessing.pool import Pool
from tqdm import tqdm
import time
# import timing
import re # import the library for regular expressions
from nltk.tokenize import ... | 0 | 0 | 0 |
8cdb7958b0bb8caf4566be41008f5ddad98b4203 | 4,450 | py | Python | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | apps/flaskexample/views.py | joelmpiper/bill_taxonomy | 9284dfae905ca8efa558b4fd93469d03cf4b8074 | [
"MIT"
] | null | null | null | from flask import render_template
from flask import request
from flaskexample import app
from sqlalchemy import create_engine
import pandas as pd
import psycopg2
import yaml
from a_Model import ModelIt
from flaskexample.support_functions import formatted_query
ymlfile = open("../configs.yml", 'r')
cfg = yaml.load(ymlf... | 29.865772 | 72 | 0.63618 | from flask import render_template
from flask import request
from flaskexample import app
from sqlalchemy import create_engine
import pandas as pd
import psycopg2
import yaml
from a_Model import ModelIt
from flaskexample.support_functions import formatted_query
ymlfile = open("../configs.yml", 'r')
cfg = yaml.load(ymlf... | 3,500 | 0 | 176 |
919c91b562b34a6a6b8fa222823d83beb6c23d2d | 71 | py | Python | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | 1 | 2015-04-29T15:19:45.000Z | 2015-04-29T15:19:45.000Z | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | null | null | null | bempy/django/blocks/cssreset/__init__.py | svetlyak40wt/bempy | ad87982d17c2d14c344d9e3d91a48c37dfb72535 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T16:08:54.000Z | 2019-06-10T16:08:54.000Z | from bempy import context_blocks
context_blocks('cssreset', locals())
| 17.75 | 36 | 0.802817 | from bempy import context_blocks
context_blocks('cssreset', locals())
| 0 | 0 | 0 |
c5098c62114ee7e651fe7e22098a41baf587b44f | 2,457 | py | Python | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/tabloid/test_dbp_2146_distinct_not_in.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.tabloid.dbp_2146_distinct_not_in
# title: Common SQL. Check correctness of the results
# decription:
# tracker_id:
# min_versions: ['2.5']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
... | 23.4 | 73 | 0.49654 | #coding:utf-8
#
# id: functional.tabloid.dbp_2146_distinct_not_in
# title: Common SQL. Check correctness of the results
# decription:
# tracker_id:
# min_versions: ['2.5']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
... | 132 | 0 | 22 |
c5cc06f128837cada07ecbefad07ffa87dff0290 | 240 | py | Python | exemplos/connect.py | Fr4ncisTaylor/HubSale-api | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | 1 | 2021-02-26T16:25:26.000Z | 2021-02-26T16:25:26.000Z | exemplos/connect.py | Fr4ncisTaylor/hubsaleapi | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | null | null | null | exemplos/connect.py | Fr4ncisTaylor/hubsaleapi | 30a2c0900b2c37503e9ba1df7b93381552eef746 | [
"Apache-2.0"
] | null | null | null | from HubSale import HubSale
from pprint import pprint
client_id = ""
client_secret = ""
hubsale = HubSale(client_id, client_secret)
code, message = hubsale.connect()
if code:
print("Success!!!")
else:
print('Oops,', message) | 18.461538 | 49 | 0.695833 | from HubSale import HubSale
from pprint import pprint
client_id = ""
client_secret = ""
hubsale = HubSale(client_id, client_secret)
code, message = hubsale.connect()
if code:
print("Success!!!")
else:
print('Oops,', message) | 0 | 0 | 0 |
39199a0dac7cb4544d8a1d3056e6f89535893cd2 | 1,816 | py | Python | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p22.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | """"""
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names,
begin by sorting it into alphabetical order. Then working out the alphabetical value for each name,
multiply this value by its alphabetical position in the list to obtain a name score.
For examp... | 46.564103 | 118 | 0.686123 | """"""
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names,
begin by sorting it into alphabetical order. Then working out the alphabetical value for each name,
multiply this value by its alphabetical position in the list to obtain a name score.
For examp... | 0 | 0 | 0 |
7cc22316f1d22ad2cc918f1334b3c3e2ab028733 | 5,950 | py | Python | src/hcrystalball/compose/_ts_column_transformer.py | pavelg087/hcrystalball | 25f186dc72d4e273c6696a5c822f601d54bab734 | [
"MIT"
] | 1 | 2021-04-12T17:08:17.000Z | 2021-04-12T17:08:17.000Z | src/hcrystalball/compose/_ts_column_transformer.py | pavelg087/hcrystalball | 25f186dc72d4e273c6696a5c822f601d54bab734 | [
"MIT"
] | null | null | null | src/hcrystalball/compose/_ts_column_transformer.py | pavelg087/hcrystalball | 25f186dc72d4e273c6696a5c822f601d54bab734 | [
"MIT"
] | 1 | 2022-01-03T16:02:35.000Z | 2022-01-03T16:02:35.000Z | from sklearn.compose import ColumnTransformer
from sklearn.utils.validation import check_array, check_is_fitted
from scipy import sparse
from collections import namedtuple
import numpy as np
import pandas as pd
class TSColumnTransformer(ColumnTransformer):
"""Time Series compatible ColumnTransformer.
Allow u... | 34 | 106 | 0.572941 | from sklearn.compose import ColumnTransformer
from sklearn.utils.validation import check_array, check_is_fitted
from scipy import sparse
from collections import namedtuple
import numpy as np
import pandas as pd
class TSColumnTransformer(ColumnTransformer):
"""Time Series compatible ColumnTransformer.
Allow u... | 293 | 0 | 26 |
1dee287b2d62edc7d71ebd34ed6960379afab04b | 1,489 | py | Python | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 8 | 2015-07-02T13:34:06.000Z | 2021-05-17T21:34:07.000Z | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 2 | 2015-11-09T17:16:07.000Z | 2020-02-19T14:00:20.000Z | seapy/subsystems/subsystemstructural.py | FRidh/seapy | de63acdb3722c2558fc1ad1e1eca92abdd027932 | [
"BSD-3-Clause"
] | 2 | 2021-02-03T08:56:10.000Z | 2022-01-22T02:21:43.000Z | """
Structural subsystem
--------------------
"""
import numpy as np
from .subsystem import Subsystem
class SubsystemStructural(Subsystem):
"""
Abstract base class for all structural subsystems.
"""
@property
def conductance_point_average(self):
"""
Average point conductance of a... | 24.409836 | 78 | 0.549362 | """
Structural subsystem
--------------------
"""
import numpy as np
from .subsystem import Subsystem
class SubsystemStructural(Subsystem):
"""
Abstract base class for all structural subsystems.
"""
@property
def conductance_point_average(self):
"""
Average point conductance of a... | 0 | 0 | 0 |
2de3988f5f3f55418bcf982e177c0e4958dcc16d | 658 | py | Python | src/bpp/migrations/0209_auto_20200421_0013.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/bpp/migrations/0209_auto_20200421_0013.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/bpp/migrations/0209_auto_20200421_0013.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-20 22:13
from django.db import migrations, models
| 24.37037 | 57 | 0.541033 | # Generated by Django 3.0.4 on 2020-04-20 22:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bpp", "0208_auto_20200329_1719"),
]
operations = [
migrations.AddField(
model_name="jednostka",
name="kolejnosc",
... | 0 | 544 | 23 |
4442a9eecfc51a9e00395d578a891bed115d0a95 | 3,159 | py | Python | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | setup.py | aerophile/python-irtrans | 20eee51b91d58d2b8dc18612003e67f9282f542f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import warnings
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dist_dir = os.path.dirname(os.path.abspath(__file__))
os.system("gunzip -kf %s/irtrans/models/* 2> /dev/null" %dist_d... | 30.375 | 135 | 0.623615 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import warnings
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dist_dir = os.path.dirname(os.path.abspath(__file__))
os.system("gunzip -kf %s/irtrans/models/* 2> /dev/null" %dist_d... | 0 | 0 | 0 |
ff4ccc3079c014b4b5c7ee90d4078134c821d5d6 | 425 | py | Python | src/Research Sims/Hydra.py | wrp94/YAFS | 8f2151a3b53dbe33d5f9b12bad6a304784504485 | [
"MIT"
] | null | null | null | src/Research Sims/Hydra.py | wrp94/YAFS | 8f2151a3b53dbe33d5f9b12bad6a304784504485 | [
"MIT"
] | null | null | null | src/Research Sims/Hydra.py | wrp94/YAFS | 8f2151a3b53dbe33d5f9b12bad6a304784504485 | [
"MIT"
] | null | null | null | import os
import time
import json
import random
import logging.config
import networkx as nx
from pathlib import Path
import matplotlib.pyplot as plt
from yafs.core import Sim
from yafs.application import create_applications_from_json
from yafs.topology import Topology
from yafs.placement import JSONPlacement
from ya... | 22.368421 | 58 | 0.863529 | import os
import time
import json
import random
import logging.config
import networkx as nx
from pathlib import Path
import matplotlib.pyplot as plt
from yafs.core import Sim
from yafs.application import create_applications_from_json
from yafs.topology import Topology
from yafs.placement import JSONPlacement
from ya... | 0 | 0 | 0 |
19e75cc217ce5dc119f9366c8c80e75e7a2d1ef1 | 1,286 | py | Python | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | ycsb/data.py | basicthinker/scripts | ba4057e37234754f689205dee7b63577e0856854 | [
"Apache-2.0"
] | null | null | null | # Created on Jan 12 2015
import statistics
import math
import os
__author__ = "Jinglei Ren"
__copyright__ = "Copyright (c) 2015 Jinglei Ren"
__email__ = "jinglei@ren.systems"
RESULTS_FILE = 'ycsb-redis.results'
| 27.956522 | 75 | 0.598756 | # Created on Jan 12 2015
import statistics
import math
import os
__author__ = "Jinglei Ren"
__copyright__ = "Copyright (c) 2015 Jinglei Ren"
__email__ = "jinglei@ren.systems"
RESULTS_FILE = 'ycsb-redis.results'
def parse(output):
run = {}
for line in output.split('\n'):
segs = [seg.strip() for seg ... | 1,001 | 0 | 69 |
94fdd0fca38bc277dfec464921116db4b10e633c | 11,123 | py | Python | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | shell/export_candidates.py | malks/carreiras | 014b95c985c36186fabe46b1f238b8fe871e724e | [
"MIT"
] | null | null | null | from oracle_conn import run_select as oc_select, run_insert as oc_insert, run_sql as oc_sql, new_conn as oc_conn
from mysql_connection import run_select as sql_select,run_sql,new_conn as sql_conn
from datetime import datetime
import re
#Get country code from senior based on country name
#Get city code from senior ba... | 45.773663 | 838 | 0.711229 | from oracle_conn import run_select as oc_select, run_insert as oc_insert, run_sql as oc_sql, new_conn as oc_conn
from mysql_connection import run_select as sql_select,run_sql,new_conn as sql_conn
from datetime import datetime
import re
#Get country code from senior based on country name
def get_country_code_from_name... | 6,538 | 0 | 286 |
e7a4b5fb09634abd1ca90bf016b92845b12b05de | 9,803 | py | Python | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | 1 | 2020-04-27T16:30:50.000Z | 2020-04-27T16:30:50.000Z | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | null | null | null | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | 1 | 2021-01-13T02:16:56.000Z | 2021-01-13T02:16:56.000Z | import json
import os
import sys
from django.conf.global_settings import * # noqa
from django.core.exceptions import ImproperlyConfigured
from unipath import Path
import dbservice as project_module
"""Base settings shared by all environments"""
# ====================================================================... | 31.931596 | 99 | 0.504437 | import json
import os
import sys
from django.conf.global_settings import * # noqa
from django.core.exceptions import ImproperlyConfigured
from unipath import Path
import dbservice as project_module
"""Base settings shared by all environments"""
# ====================================================================... | 767 | 0 | 46 |
5fd11a23880c15d1d662e913d958ca72bd0a6c2f | 5,568 | py | Python | Chapter04/Activity4.02/Activity4.02_Unit_test.py | PacktWorkshops/Applied-Deep-Learning-with-Keras | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 1 | 2021-02-16T13:28:41.000Z | 2021-02-16T13:28:41.000Z | Chapter04/Activity4.02/Activity4.02_Unit_test.py | olavomendes/The-Deep-Learning-with-Keras-Workshop | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 6 | 2021-04-30T21:35:53.000Z | 2022-02-10T02:55:31.000Z | Chapter04/Activity4.02/Activity4.02_Unit_test.py | olavomendes/The-Deep-Learning-with-Keras-Workshop | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 2 | 2020-01-03T10:22:19.000Z | 2020-01-13T06:30:33.000Z | import unittest
import numpy as np
import pandas as pd
import numpy.testing as np_testing
import pandas.testing as pd_testing
import os
import import_ipynb
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Activation
from tensorflow import random
fr... | 40.642336 | 135 | 0.668463 | import unittest
import numpy as np
import pandas as pd
import numpy.testing as np_testing
import pandas.testing as pd_testing
import os
import import_ipynb
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Activation
from tensorflow import random
fr... | 4,750 | 9 | 266 |
71beae10da7209eb415ac2446f2c563e76e25076 | 3,832 | py | Python | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 1 | 2019-11-14T15:18:45.000Z | 2019-11-14T15:18:45.000Z | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 2 | 2019-09-27T08:49:39.000Z | 2021-03-23T17:09:13.000Z | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 3 | 2019-10-04T12:12:40.000Z | 2021-01-28T16:33:32.000Z | # This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'sentry.db.postgres',
'NAME': '{{ sentry_db_name }... | 27.177305 | 80 | 0.683455 | # This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'sentry.db.postgres',
'NAME': '{{ sentry_db_name }... | 0 | 0 | 0 |
1719680479b4b558551123effe8d23c6a8b5ce10 | 3,402 | py | Python | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | null | null | null | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | 1 | 2021-02-08T20:21:10.000Z | 2021-02-08T20:21:10.000Z | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
from text_stoppers import *
from text_validators import *
from random import choice
class MarkovGenerator(object):
"""A Markov chain text generator"""
def open_and_read_file(self, filename):
"""Take file(s) as tuples; return text ... | 29.842105 | 84 | 0.574956 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
from text_stoppers import *
from text_validators import *
from random import choice
class MarkovGenerator(object):
"""A Markov chain text generator"""
def open_and_read_file(self, filename):
"""Take file(s) as tuples; return text ... | 305 | 0 | 23 |
cde00c76f75eb8efb107ab70115d81a15e0bb8b3 | 3,238 | py | Python | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 9 | 2017-11-25T15:18:12.000Z | 2022-01-04T09:49:20.000Z | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 22 | 2018-01-16T11:31:20.000Z | 2022-03-15T12:19:13.000Z | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 4 | 2017-12-01T13:39:14.000Z | 2022-02-04T23:45:03.000Z | from typing import Any, Callable, Dict
import datetime
import os
from blossom_wrapper import BlossomAPI
from praw import Reddit
# Load configuration regardless of if bugsnag is setup correctly
try:
import bugsnag
except ImportError:
# If loading from setup.py or bugsnag isn't installed, we
# don't want to... | 29.706422 | 83 | 0.675108 | from typing import Any, Callable, Dict
import datetime
import os
from blossom_wrapper import BlossomAPI
from praw import Reddit
# Load configuration regardless of if bugsnag is setup correctly
try:
import bugsnag
except ImportError:
# If loading from setup.py or bugsnag isn't installed, we
# don't want to... | 624 | 0 | 80 |
d97c3c948b0111a84042fd8c4b136d61148ac89c | 1,260 | py | Python | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | null | null | null | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | null | null | null | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | 1 | 2019-12-12T15:26:31.000Z | 2019-12-12T15:26:31.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='pipsy',
version="0.1.2",
description='Shows updates for installed packages',
long_description='Shows available updates and security notices for installed packages',
author='Donovan Schönknecht',
author_email='don@... | 30 | 91 | 0.585714 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='pipsy',
version="0.1.2",
description='Shows updates for installed packages',
long_description='Shows available updates and security notices for installed packages',
author='Donovan Schönknecht',
author_email='don@... | 0 | 0 | 0 |
358d4ccfa2bc5618f4f6f68e382750cc2bc16f77 | 939 | py | Python | vad/acoustics/transforms/mel_spectrogram.py | zsl24/voice-activity-detection | a034be23c6283121c6b72e778c6ff6711045cbe3 | [
"MIT"
] | 74 | 2021-02-22T17:35:52.000Z | 2022-03-29T03:08:12.000Z | vad/acoustics/transforms/mel_spectrogram.py | zsl24/voice-activity-detection | a034be23c6283121c6b72e778c6ff6711045cbe3 | [
"MIT"
] | 1 | 2021-08-15T07:56:39.000Z | 2021-08-15T07:56:39.000Z | vad/acoustics/transforms/mel_spectrogram.py | zsl24/voice-activity-detection | a034be23c6283121c6b72e778c6ff6711045cbe3 | [
"MIT"
] | 9 | 2021-07-22T16:46:11.000Z | 2022-03-27T13:19:24.000Z | import librosa
import numpy as np
from vad.acoustics.transforms.transform import Transform
from vad.data_models.audio_data import AudioData
| 29.34375 | 77 | 0.660277 | import librosa
import numpy as np
from vad.acoustics.transforms.transform import Transform
from vad.data_models.audio_data import AudioData
class MelSpectrogramTransform(Transform):
feature_size: int
def __init__(self, n_fft: int, hop_ms: int, window_ms: int, n_mels: int):
self.n_fft = n_fft
... | 678 | 96 | 23 |
811a5527f91208edd02db398831978cdf699e4ae | 3,167 | py | Python | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | null | null | null | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | null | null | null | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | 3 | 2019-03-03T16:48:21.000Z | 2021-11-18T09:35:47.000Z | import traceback
import os
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.linear_model import SGDRegressor
from machine_learner.utils import repository
DIR_PATH = os.path.join('machine_learner', 'trained_models', 'pllaregression')
| 36.825581 | 117 | 0.668772 | import traceback
import os
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.linear_model import SGDRegressor
from machine_learner.utils import repository
DIR_PATH = os.path.join('machine_learner', 'trained_models', 'pllaregression')
def training(features, target_pl, target_la, cycle):
... | 2,851 | 0 | 46 |
08f19e444351c614538acac185696342a390748d | 3,676 | py | Python | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | 1 | 2021-03-20T00:32:17.000Z | 2021-03-20T00:32:17.000Z | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | """submission table
Revision ID: 143f81c3bba3
Revises:
Create Date: 2019-02-25 21:25:17.891423
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
... | 81.688889 | 929 | 0.726333 | """submission table
Revision ID: 143f81c3bba3
Revises:
Create Date: 2019-02-25 21:25:17.891423
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
... | 3,308 | 0 | 46 |
7c64a6b1ab3058e8ebef0ebd3cd11fb5ea4faca3 | 2,614 | py | Python | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
import os
USERNAME = os.environ.get('USERNAME')
PASSWORD = os.environ.get('PASSWORD')
CLUSTER_INFO = os.environ.get('CLUSTER_INFO')
DB_NAME = os.environ.get('DB_NAME')
COLLECTION_NAME = os.environ.get('COLLECTION_NAME')
cluster = MongoClient(f'mongodb+srv://{USERNAME}:{PASSWORD}{CLUSTER... | 31.119048 | 89 | 0.686687 | from pymongo import MongoClient
import os
USERNAME = os.environ.get('USERNAME')
PASSWORD = os.environ.get('PASSWORD')
CLUSTER_INFO = os.environ.get('CLUSTER_INFO')
DB_NAME = os.environ.get('DB_NAME')
COLLECTION_NAME = os.environ.get('COLLECTION_NAME')
cluster = MongoClient(f'mongodb+srv://{USERNAME}:{PASSWORD}{CLUSTER... | 94 | 0 | 22 |
7dc90d10b2d08adc43f1f0611471659f468173a4 | 3,911 | py | Python | restclients/test/bridge/models.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/test/bridge/models.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/test/bridge/models.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from django.test import TestCase
from django.utils.dateparse import parse_datetime
from restclients.exceptions import DataFailureException
from restclients.models.bridge import BridgeUser, BridgeCustomField,\
BridgeUserRole
from restclients.test import fdao_pws_override
| 39.505051 | 75 | 0.489645 | from datetime import datetime
from django.test import TestCase
from django.utils.dateparse import parse_datetime
from restclients.exceptions import DataFailureException
from restclients.models.bridge import BridgeUser, BridgeCustomField,\
BridgeUserRole
from restclients.test import fdao_pws_override
class TestBri... | 3,490 | 11 | 104 |
40980b6b967b533d1cc5c012af6e07cf8d2c9df3 | 519 | py | Python | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | """Version of str(timedelta) which is not English specific."""
def duration_string(duration):
days = duration.days
seconds = duration.seconds
microseconds = duration.microseconds
minutes = seconds // 60
seconds = seconds % 60
hours = minutes // 60
minutes = minutes % 60
string = '{:... | 519 | 519 | 0.626204 | """Version of str(timedelta) which is not English specific."""
def duration_string(duration):
days = duration.days
seconds = duration.seconds
microseconds = duration.microseconds
minutes = seconds // 60
seconds = seconds % 60
hours = minutes // 60
minutes = minutes % 60
string = '{:... | 0 | 0 | 0 |
fc87b40add6ed0b9a6c53461503078e30928e2cd | 8,957 | py | Python | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | 1 | 2020-03-13T10:30:11.000Z | 2020-03-13T10:30:11.000Z | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | """
The dependency-decomposition based unique measure partial information decomposition.
"""
from ...multivariate import coinformation
from ..pid import BaseUniquePID
from ...profiles import DependencyDecomposition
__all__ = (
'PID_dep',
'PID_RA',
)
class PID_dep(BaseUniquePID):
"""
The dependency ... | 35.12549 | 98 | 0.592609 | """
The dependency-decomposition based unique measure partial information decomposition.
"""
from ...multivariate import coinformation
from ..pid import BaseUniquePID
from ...profiles import DependencyDecomposition
__all__ = (
'PID_dep',
'PID_RA',
)
class PID_dep(BaseUniquePID):
"""
The dependency ... | 0 | 0 | 0 |
ce9cd9ea62d77873530a9f44bd71aefdee85fa49 | 967 | py | Python | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | 1 | 2019-11-22T16:37:34.000Z | 2019-11-22T16:37:34.000Z | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | 9 | 2018-05-24T20:47:26.000Z | 2019-07-02T21:30:54.000Z | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools
setuptools.setup(
name='capalyzer',
version='2.16.0',
description="Parsing functionality for the metasub CAP",
author="David C. Danko",
author_email='dcdanko@gmail.com',
url='https://github.com/dcdanko/capalyzer',
p... | 24.794872 | 60 | 0.584281 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools
setuptools.setup(
name='capalyzer',
version='2.16.0',
description="Parsing functionality for the metasub CAP",
author="David C. Danko",
author_email='dcdanko@gmail.com',
url='https://github.com/dcdanko/capalyzer',
p... | 0 | 0 | 0 |
c525f1062309bd1fe185d1192e1da1b6b6556d8d | 1,180 | py | Python | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | import toml
import os
import datetime
import itertools
#load config.toml
cwd = os.getcwd()
path = os.path.join(cwd,'terrain-corrector','terrain','settings','config.toml')
config = toml.load(path)
#add config to locals
locals().update(config)
#...and a few more expressive variations
BOUNDS = [*EAST_BOUNDS, *NORTH_BOUND... | 36.875 | 79 | 0.734746 | import toml
import os
import datetime
import itertools
#load config.toml
cwd = os.getcwd()
path = os.path.join(cwd,'terrain-corrector','terrain','settings','config.toml')
config = toml.load(path)
#add config to locals
locals().update(config)
#...and a few more expressive variations
BOUNDS = [*EAST_BOUNDS, *NORTH_BOUND... | 0 | 0 | 0 |
5329905446ed059c91fefa7dd21cbee32116b9ff | 1,992 | py | Python | pycozmo/CozmoAnim/BodyMotion.py | gimait/pycozmo | 601d9c09903b9300e8990723cae95974212afb09 | [
"MIT"
] | 123 | 2019-08-25T21:28:23.000Z | 2022-03-12T13:54:59.000Z | pycozmo/CozmoAnim/BodyMotion.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 41 | 2019-08-25T21:21:37.000Z | 2022-02-09T14:20:54.000Z | pycozmo/CozmoAnim/BodyMotion.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 51 | 2019-09-04T13:30:02.000Z | 2022-01-09T01:20:24.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: CozmoAnim
import flatbuffers
| 36.218182 | 145 | 0.697289 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: CozmoAnim
import flatbuffers
class BodyMotion(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsBodyMotion(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Bo... | 1,430 | 293 | 156 |
9fb83f694c47b019db04efa9f0f92de9216748d1 | 33,041 | py | Python | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | #:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
vesper.app
==========
This module defines the framework used by Vesper to bootstrap a running server from
a given configuration.
"""
import os, os.path, sys, tr... | 40.244823 | 106 | 0.593293 | #:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
vesper.app
==========
This module defines the framework used by Vesper to bootstrap a running server from
a given configuration.
"""
import os, os.path, sys, tr... | 14,859 | 7,178 | 431 |
bcd6579d525079638df83054d35c397e48a72c3d | 735 | py | Python | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | from step_02_data_analyzer import data, target
from step_05_classify_data import t
from sklearn.decomposition import PCA
from pylab import plot, show, figure, subplot
pca = PCA(n_components=2)
pcad = pca.fit_transform(data)
figure()
subplot(211)
plot(pcad[target=='setosa',0],pcad[target=='setosa',1],'bo')
plot(pcad... | 27.222222 | 68 | 0.730612 | from step_02_data_analyzer import data, target
from step_05_classify_data import t
from sklearn.decomposition import PCA
from pylab import plot, show, figure, subplot
pca = PCA(n_components=2)
pcad = pca.fit_transform(data)
figure()
subplot(211)
plot(pcad[target=='setosa',0],pcad[target=='setosa',1],'bo')
plot(pcad... | 0 | 0 | 0 |
304600ad47ed3e4d99b4c1352f494e355e985269 | 22,113 | py | Python | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | 1 | 2016-09-23T07:22:46.000Z | 2016-09-23T07:22:46.000Z | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | null | null | null | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | null | null | null | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... | 30.458678 | 90 | 0.608149 | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... | 8,243 | 194 | 635 |
77c23b75bb2085f24c3aae732cc4256d128367c4 | 968 | py | Python | python/search/find_k.py | rgabeflores/Structures-Functions-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | 1 | 2019-12-05T06:49:34.000Z | 2019-12-05T06:49:34.000Z | python/search/find_k.py | rgabeflores/Data-Structures-and-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | null | null | null | python/search/find_k.py | rgabeflores/Data-Structures-and-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | null | null | null | import random as r
if __name__ == "__main__":
main() | 18.264151 | 71 | 0.603306 | import random as r
def find_k(a,key):
pivot = get_pivot(a)
left = list()
right = list()
for x in a:
if x <= pivot:
left.append(x)
else:
right.append(x)
length = len(left)
if(length > key):
return find_k(left,key)
elif(length == key):
return pivot
else:
return find_k(right, (key - (len(left))... | 845 | 0 | 69 |
675b1020da5a77b7b649dc1568b5d103f6d1849f | 2,020 | py | Python | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import json
import time
import random
import hashlib
import urllib
import urllib2
if __name__ == '__main__':
html = send_request()
dict_obj = json.loads(html)
# 翻译的内容
print(dict_obj["translateResult"][0][0]["tgt"])
| 32.580645 | 241 | 0.612871 | # -*- coding:utf-8 -*-
import json
import time
import random
import hashlib
import urllib
import urllib2
def send_request():
# js解密算法数据
r = str(int(time.time() * 1000) + random.randint(0, 10))
D = "ebSeFb%=XZ%T[KZ)c(sy!"
S = "fanyideskweb"
n = raw_input("请输入需要翻译的文字:")
sign = hashlib.md5(r + D +... | 1,772 | 0 | 23 |
ae287f1bbd7cb8cd3d571bb67523ab57d8016931 | 5,647 | py | Python | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | from Desktop.chess-nn.minimax_lookup import *
from Desktop.chess-nn.evl_conv_3 import model_fn
with tf.device('/gpu:0'):
evl_conv_temp = tf.estimator.Estimator(
model_fn = model_fn, model_dir = './DNN/evl_conv_5')
player_side = input("Please choose your side(b/w): ")
difficulty = input("Choose Diff... | 31.027473 | 102 | 0.561183 | from Desktop.chess-nn.minimax_lookup import *
from Desktop.chess-nn.evl_conv_3 import model_fn
def predict_input_fn(data):
data = data.astype('float32')
tmp = {'x':data}
return tf.estimator.inputs.numpy_input_fn(x = tmp,num_epochs = 1, shuffle = False )
with tf.device('/gpu:0'):
evl_conv_temp = tf... | 4,853 | 0 | 226 |
e1bd0b4f7e3fdaf1db8c14492ba9eb4962748dc8 | 337 | py | Python | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2021-12-01T06:47:30.000Z | 2021-12-07T06:19:37.000Z | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2021-08-12T08:19:12.000Z | 2021-08-18T10:54:37.000Z | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2020-09-07T11:03:01.000Z | 2020-10-03T14:42:20.000Z | import libnum
import hashlib
import random
n=8269
g=11
password = "Hello"
x = int(hashlib.sha256(password.encode()).hexdigest()[:8], 16) % n
print('\n======Phase 4: Peggy recieves c and calculate r=v-cx, sends r to Victor==================')
c = input("c= ")
v = input("v= ")
r = (int(v) - int(c) * x) % (n-1)
print(... | 21.0625 | 100 | 0.581602 | import libnum
import hashlib
import random
n=8269
g=11
password = "Hello"
x = int(hashlib.sha256(password.encode()).hexdigest()[:8], 16) % n
print('\n======Phase 4: Peggy recieves c and calculate r=v-cx, sends r to Victor==================')
c = input("c= ")
v = input("v= ")
r = (int(v) - int(c) * x) % (n-1)
print(... | 0 | 0 | 0 |
640a6657a3bc0f55296326d6b8fe5a3ef57711e7 | 2,180 | py | Python | tests/task/nlp/test_masked_language_modeling.py | mariomeissner/lightning-transformers | 4efda7b4e924b37956c7a008ca01819f5c3f98c8 | [
"Apache-2.0"
] | 451 | 2021-04-21T15:53:59.000Z | 2022-03-29T10:39:45.000Z | tests/task/nlp/test_masked_language_modeling.py | mathemusician/lightning-transformers | b2ef06113433e6a178ce4d3c9df7ede8064e247f | [
"Apache-2.0"
] | 92 | 2021-04-21T18:42:58.000Z | 2022-03-30T05:29:54.000Z | tests/task/nlp/test_masked_language_modeling.py | mathemusician/lightning-transformers | b2ef06113433e6a178ce4d3c9df7ede8064e247f | [
"Apache-2.0"
] | 51 | 2021-04-22T05:35:28.000Z | 2022-03-17T13:08:12.000Z | import sys
from unittest.mock import MagicMock
import pytest
import pytorch_lightning as pl
import torch
from transformers import AutoTokenizer
from lightning_transformers.core.nlp import HFBackboneConfig
from lightning_transformers.task.nlp.masked_language_modeling import (
MaskedLanguageModelingDataModule,
... | 35.737705 | 116 | 0.765138 | import sys
from unittest.mock import MagicMock
import pytest
import pytorch_lightning as pl
import torch
from transformers import AutoTokenizer
from lightning_transformers.core.nlp import HFBackboneConfig
from lightning_transformers.task.nlp.masked_language_modeling import (
MaskedLanguageModelingDataModule,
... | 1,504 | 0 | 114 |