hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bc8ce23b2de1c59918fb8dc6dfc87ea85a63c990 | 2,733 | py | Python | atc/LINE-master/train.py | anaeliaovalle/atc-mt-dti | 755bd175e852ef2a6792be7244b006ebed252d8d | [
"MIT"
] | null | null | null | atc/LINE-master/train.py | anaeliaovalle/atc-mt-dti | 755bd175e852ef2a6792be7244b006ebed252d8d | [
"MIT"
] | null | null | null | atc/LINE-master/train.py | anaeliaovalle/atc-mt-dti | 755bd175e852ef2a6792be7244b006ebed252d8d | [
"MIT"
] | null | null | null | import argparse
from utils.line import Line
from tqdm import trange
import torch
import torch.optim as optim
import sys
import pickle
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-g", "--graph_path", type=str)
parser.add_argument("-save", "--save_path", type=str)
... | 36.932432 | 89 | 0.631906 | import argparse
from utils.utils import *
from utils.line import Line
from tqdm import trange
import torch
import torch.optim as optim
import sys
import pickle
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-g", "--graph_path", type=str)
parser.add_argument("-save", "--... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
e350a391ac04e2b8526a0c505584efa8bd49131b | 13,994 | py | Python | sdtv4/SDT4Parser.py | Homegateway/SDTTool | 97e698ce3078595a6755ec0b599838dc903eaa3d | [
"Apache-2.0"
] | 2 | 2018-05-14T16:00:23.000Z | 2018-12-26T14:02:51.000Z | sdtv4/SDT4Parser.py | Homegateway/SDTTool | 97e698ce3078595a6755ec0b599838dc903eaa3d | [
"Apache-2.0"
] | null | null | null | sdtv4/SDT4Parser.py | Homegateway/SDTTool | 97e698ce3078595a6755ec0b599838dc903eaa3d | [
"Apache-2.0"
] | 2 | 2016-09-05T09:24:41.000Z | 2020-06-23T14:05:45.000Z | # SDT4Parser.py
#
# Callback target class for the ElementTree parser to parse a SDT4
#
# Hanlder for each of the element types
#
#
# Assignment of element types and (handlerFunction, (tuple of allowed parents))
#
handlers = {
SDT4Parser.actionTag : (handleAction, (SDT4ModuleClass,)... | 31.376682 | 223 | 0.736101 | # SDT4Parser.py
#
# Callback target class for the ElementTree parser to parse a SDT4
from .SDT4Classes import *
class SDT4Parser:
# Define the element tags of the SDT4
actionTag = 'action'
actionsTag = 'actions'
argTag = 'arg'
argsTag = 'args'
arrayTypeTag = 'array'
constraintTag ... | 0 | 0 | 0 | 4,476 | 0 | 6,438 | 0 | 5 | 690 |
de130291f9918c171aaa53459b784a3e93f4b849 | 1,698 | py | Python | tools/validator.py | adacker10/showdown | 8ceb1ff46d5c33ec3055928d6ad293224446f63c | [
"MIT"
] | 8 | 2019-02-02T01:15:57.000Z | 2021-12-23T04:43:46.000Z | tools/validator.py | adacker10/showdown | 8ceb1ff46d5c33ec3055928d6ad293224446f63c | [
"MIT"
] | null | null | null | tools/validator.py | adacker10/showdown | 8ceb1ff46d5c33ec3055928d6ad293224446f63c | [
"MIT"
] | 6 | 2020-09-11T13:15:05.000Z | 2022-03-18T15:46:35.000Z | from data import dex
import re
def validate_team(team):
'''
team is an array of six pokemon sets
'''
if len(team) > 6:
raise InValidSetError("more than 6 pokemon")
pokemon_names = set()
for pokemon in team:
# check if the pokemon is an actual pokemon
species = re.sub(r'... | 40.428571 | 154 | 0.602473 | from data import dex
import re
class InValidSetError(Exception):
def __init__(self, message):
self.message = message
def validate_team(team):
'''
team is an array of six pokemon sets
'''
if len(team) > 6:
raise InValidSetError("more than 6 pokemon")
pokemon_names = set()
f... | 0 | 0 | 0 | 76 | 0 | 0 | 0 | 0 | 23 |
bceb90c866742318115d3897625ab3cd17dad9ae | 1,782 | py | Python | abfs/group_data_split.py | rcdilorenzo/abfs | a897d00a4589a9412a9b9e737f8db91df008fc26 | [
"MIT"
] | 7 | 2019-03-13T17:22:50.000Z | 2022-01-09T09:03:16.000Z | abfs/group_data_split.py | rcdilorenzo/abfs | a897d00a4589a9412a9b9e737f8db91df008fc26 | [
"MIT"
] | 1 | 2019-08-01T23:42:09.000Z | 2019-08-02T16:14:31.000Z | abfs/group_data_split.py | rcdilorenzo/abfs | a897d00a4589a9412a9b9e737f8db91df008fc26 | [
"MIT"
] | 2 | 2020-09-12T06:33:16.000Z | 2021-01-01T01:05:48.000Z | from collections import namedtuple as Struct
DataSplitConfig = Struct('DataSplitConfig', ['validation_size', 'test_size', 'random_seed'])
DEFAULT_SPLIT_CONFIG = DataSplitConfig(0.2, 0.2, 1337)
| 30.724138 | 92 | 0.640292 | from collections import namedtuple as Struct
from sklearn.model_selection import GroupShuffleSplit, ShuffleSplit
DataSplitConfig = Struct('DataSplitConfig', ['validation_size', 'test_size', 'random_seed'])
DEFAULT_SPLIT_CONFIG = DataSplitConfig(0.2, 0.2, 1337)
class GroupDataSplit():
def __init__(self, df, key, ... | 0 | 605 | 0 | 891 | 0 | 0 | 0 | 46 | 45 |
b1412972007124b927dd10c01b84ccee4179e203 | 656 | py | Python | data_extract_code/sex-ratio.py | jaya-shankar/Human-Development-Prediction | cdc7f2186c49db3506267573b05da6ba03cd5bfd | [
"Unlicense"
] | null | null | null | data_extract_code/sex-ratio.py | jaya-shankar/Human-Development-Prediction | cdc7f2186c49db3506267573b05da6ba03cd5bfd | [
"Unlicense"
] | null | null | null | data_extract_code/sex-ratio.py | jaya-shankar/Human-Development-Prediction | cdc7f2186c49db3506267573b05da6ba03cd5bfd | [
"Unlicense"
] | 2 | 2021-11-01T15:48:16.000Z | 2021-12-28T07:48:35.000Z | import csv
file = open("sex-ratio.csv")
csvreader = csv.reader(file)
header = next(csvreader)
mapped = {}
for row in csvreader:
if(row[0] not in mapped):
mapped[row[0]]={}
mapped[row[0]][row[2]] = row[3]
# f = open("converted.csv",'w')
rows=[]
for c in mapped:
row = [c]
for y in mapped[c]:... | 18.222222 | 54 | 0.599085 | import csv
file = open("sex-ratio.csv")
csvreader = csv.reader(file)
header = next(csvreader)
mapped = {}
for row in csvreader:
if(row[0] not in mapped):
mapped[row[0]]={}
mapped[row[0]][row[2]] = row[3]
# f = open("converted.csv",'w')
rows=[]
for c in mapped:
row = [c]
for y in mapped[c]:... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31f4a614a97ec199afd65d00866fe66229803029 | 525 | py | Python | lib/flask_api/compat.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | lib/flask_api/compat.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | lib/flask_api/compat.py | imtiaz-emu/gcp-flask-test | 096f466242aa14941712ab8ea06ac4fb4eaeb993 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
# Markdown is optional
try:
import markdown
def apply_markdown(text):
"""
Simple wrapper around :func:`markdown.markdown` to set the base level
of '#' style headers to <h2>.
"""
extensions... | 25 | 77 | 0.645714 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
# Markdown is optional
try:
import markdown
def apply_markdown(text):
"""
Simple wrapper around :func:`markdown.markdown` to set the base level
of '#' style headers to <h2>.
"""
extensions... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6bff53885f7d7817bb5989d427b6919245c38e01 | 4,969 | py | Python | src/cfdpy/derivative/finiteDifferenceMethods.py | mkihara/cfdpy | 53945ddd87f810e65d4fffe3b68f6bf8c06098c2 | [
"MIT"
] | 1 | 2022-03-28T03:07:26.000Z | 2022-03-28T03:07:26.000Z | src/cfdpy/derivative/finiteDifferenceMethods.py | mkihara/cfdpy | 53945ddd87f810e65d4fffe3b68f6bf8c06098c2 | [
"MIT"
] | null | null | null | src/cfdpy/derivative/finiteDifferenceMethods.py | mkihara/cfdpy | 53945ddd87f810e65d4fffe3b68f6bf8c06098c2 | [
"MIT"
] | null | null | null | """Finite Difference Methods
"""
import numpy as np
def FDMWeights(M, x0, alpha):
"""Calculate the weights in finite difference formulas
for any order of derivative and to any order of accuracy
on onedimensional grids with arbitrary spacing.
Args:
M (int): Order of derivative
x0 (flo... | 38.51938 | 105 | 0.603944 | """Finite Difference Methods
"""
import numpy as np
def FDMWeights(M, x0, alpha):
"""Calculate the weights in finite difference formulas
for any order of derivative and to any order of accuracy
on onedimensional grids with arbitrary spacing.
Args:
M (int): Order of derivative
x0 (flo... | 0 | 0 | 0 | 3,725 | 0 | 0 | 0 | 0 | 46 |
ff72c44c7b3d8e713ec5a01de73d9db8358095b9 | 7,381 | py | Python | revcar-cli.py | madkaye/revcar-cli | c49a0ae47b1545c81d53d4fb5ddccbc73203caa2 | [
"MIT"
] | null | null | null | revcar-cli.py | madkaye/revcar-cli | c49a0ae47b1545c81d53d4fb5ddccbc73203caa2 | [
"MIT"
] | null | null | null | revcar-cli.py | madkaye/revcar-cli | c49a0ae47b1545c81d53d4fb5ddccbc73203caa2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import curses
# Scan timeout in seconds
SCAN_TIMEOUT = 10
## screen parts
LINE_HEADING = 0
LINE_OPTIONS = 1
LINE_STATUS = 5
LINE_ERROR = 6
COL_START = 0
HEIGHT_TOP = 8
HEIGHT_BOT = 3
LOOP_DURATION = 0.05
DISPLAY_COUNT = 100
LINE_RECT = 30
RECT_HEIGHT = 12
RECT_WIDTH = 40
MSG_WELC... | 34.013825 | 122 | 0.562796 | #!/usr/bin/env python3
import os
import time
import datetime
from bluepy import btle
from bluepy.btle import Scanner, DefaultDelegate, Peripheral, Characteristic, ScanEntry, Service, UUID
import curses
import curses.textpad
from carcontrol import CarControl
# Scan timeout in seconds
SCAN_TIMEOUT = 10
## screen part... | 0 | 0 | 0 | 6,385 | 0 | 0 | 0 | 79 | 156 |
cbfa2caf1265110b8014de4c1cbc3f72c30c2833 | 2,736 | py | Python | landwatch/model/unet.py | Lleyton-Ariton/landwatch | 21e86e899d33d0ee349cf9bf87c6c13ebdab82fa | [
"MIT"
] | 1 | 2021-06-07T06:04:49.000Z | 2021-06-07T06:04:49.000Z | landwatch/model/unet.py | Lleyton-Ariton/landwatch | 21e86e899d33d0ee349cf9bf87c6c13ebdab82fa | [
"MIT"
] | null | null | null | landwatch/model/unet.py | Lleyton-Ariton/landwatch | 21e86e899d33d0ee349cf9bf87c6c13ebdab82fa | [
"MIT"
] | null | null | null | import torch.nn as nn
| 26.057143 | 88 | 0.574196 | import math
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels: int, out_channels: int):
super().__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.conv_block = nn.Sequential(
nn.Conv2d(self.in_... | 0 | 0 | 0 | 2,616 | 0 | 0 | 0 | -19 | 114 |
0e2664f2020e42cdf1e34c5553fdb17e94b6240a | 5,580 | py | Python | spycy/operator.py | kanales/spycy | f8702bcbfed8eb60bc6e3fca76cb30d781d69cb0 | [
"MIT"
] | null | null | null | spycy/operator.py | kanales/spycy | f8702bcbfed8eb60bc6e3fca76cb30d781d69cb0 | [
"MIT"
] | null | null | null | spycy/operator.py | kanales/spycy | f8702bcbfed8eb60bc6e3fca76cb30d781d69cb0 | [
"MIT"
] | null | null | null | """
This module contains all the functions from the ``operator`` module (bar some
functions that dind't feel like they belonged here) transformed into a
spice so it can be used more confortable.
:Example:
Consider adding ``2`` to a list of numbers::
map(add(2), [1,2,3,4,5])
"""
import operator
from spycy impor... | 45.365854 | 112 | 0.704659 | """
This module contains all the functions from the ``operator`` module (bar some
functions that dind't feel like they belonged here) transformed into a
spice so it can be used more confortable.
:Example:
Consider adding ``2`` to a list of numbers::
map(add(2), [1,2,3,4,5])
"""
import operator
from spycy impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8f22602f2a4aaf4a77b2fbdbfd6ec7f59e6787bf | 2,577 | bzl | Python | recipes/brotli/config.bzl | curoky/rules_cc | 943408c05e2204e1e603b70db05037217a53868d | [
"Apache-2.0"
] | 3 | 2022-02-06T10:10:44.000Z | 2022-02-07T11:53:25.000Z | recipes/brotli/config.bzl | curoky/rules_cc | 943408c05e2204e1e603b70db05037217a53868d | [
"Apache-2.0"
] | null | null | null | recipes/brotli/config.bzl | curoky/rules_cc | 943408c05e2204e1e603b70db05037217a53868d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 curoky(cccuroky@gmail.com).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 57.266667 | 236 | 0.668607 | # Copyright 2021 curoky(cccuroky@gmail.com).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1e9f1106e32966139e9187c455ded6eb0bcb3ee5 | 565 | py | Python | vvphotos/serializers.py | synw/django-vvphotos | 3dd93fbe8a29d8db6fe440a40ee700d229da537b | [
"MIT"
] | 1 | 2017-04-05T04:09:00.000Z | 2017-04-05T04:09:00.000Z | vvphotos/serializers.py | synw/django-vvphotos | 3dd93fbe8a29d8db6fe440a40ee700d229da537b | [
"MIT"
] | null | null | null | vvphotos/serializers.py | synw/django-vvphotos | 3dd93fbe8a29d8db6fe440a40ee700d229da537b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 25.681818 | 106 | 0.677876 | # -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from vvphotos.models import Album
class AlbumSerializer(serializers.ModelSerializer):
class Meta:
model = Album
fields = read_only_fields = ["slug", "title", "image", "descri... | 0 | 0 | 0 | 359 | 0 | 0 | 0 | 66 | 113 |
2e44b8dfcbd49f05cef5d226ed68147f4d615605 | 6,650 | py | Python | docusign_esign/models/currency_feature_set_price.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/currency_feature_set_price.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/currency_feature_set_price.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
| 30.365297 | 126 | 0.603308 | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from p... | 0 | 3,323 | 0 | 2,926 | 0 | 0 | 0 | -3 | 90 |
374c484b3ff01260b21cf925102e1875ef9938a6 | 477 | py | Python | WarelogPyApi/app.py | propil5/WarelogManager | 6baf338855175259877257352f9986a02ffd3e2e | [
"MIT"
] | null | null | null | WarelogPyApi/app.py | propil5/WarelogManager | 6baf338855175259877257352f9986a02ffd3e2e | [
"MIT"
] | null | null | null | WarelogPyApi/app.py | propil5/WarelogManager | 6baf338855175259877257352f9986a02ffd3e2e | [
"MIT"
] | null | null | null | from flask import Flask
# from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with
# from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
# api = Api(app) | 29.8125 | 80 | 0.769392 | from flask.helpers import url_for
from pyTrendsExtensions import GetTrendingOverTime
from flask import Flask, redirect
# from flask_restful import Api, Resource, reqparse, abort, fields, marshal_with
# from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
# api = Api(app)
@app.route("/")
def hello():
retu... | 0 | 150 | 0 | 0 | 0 | 0 | 0 | 51 | 90 |
06d5b67bfa6a6b800139d199e86030897e4fbec4 | 1,190 | py | Python | TCPServer/server.py | listenzcc/BCIMiddleware | 80f74731b4df7f6da84c5df0c67e0ca4e6af7102 | [
"MIT"
] | null | null | null | TCPServer/server.py | listenzcc/BCIMiddleware | 80f74731b4df7f6da84c5df0c67e0ca4e6af7102 | [
"MIT"
] | null | null | null | TCPServer/server.py | listenzcc/BCIMiddleware | 80f74731b4df7f6da84c5df0c67e0ca4e6af7102 | [
"MIT"
] | null | null | null | '''
TCP server interface for console.
The TCP server will be automatically built.
- @interface: The function for user interface, and keep the server running.
'''
from .defines import TCPServer
server = TCPServer()
server.start()
| 23.8 | 76 | 0.532773 | '''
TCP server interface for console.
The TCP server will be automatically built.
- @interface: The function for user interface, and keep the server running.
'''
from . import logger
from .defines import TCPServer
server = TCPServer()
server.start()
def interface():
logger.info(f'Interface start... | 0 | 0 | 0 | 0 | 0 | 898 | 0 | -1 | 50 |
8212a3f51dd0ff690f96c791a8239dc4e79430a6 | 2,225 | py | Python | whale/src/choiceHeuristic.py | margaal/whale | 00f0743a49e383319cec2d38883697774956ffc5 | [
"MIT",
"Unlicense"
] | null | null | null | whale/src/choiceHeuristic.py | margaal/whale | 00f0743a49e383319cec2d38883697774956ffc5 | [
"MIT",
"Unlicense"
] | null | null | null | whale/src/choiceHeuristic.py | margaal/whale | 00f0743a49e383319cec2d38883697774956ffc5 | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
""" This module contains all class to manage variable choice Heuristic """ | 33.712121 | 127 | 0.595056 | #!/usr/bin/env python3
""" This module contains all class to manage variable choice Heuristic """
class VariableChoiceHeuristic:
""" Super class to handle variable choice heuristic """
def __init__(self, vars):
"""
Args:
vars (set): variables used in all clauses.
"""
... | 0 | 0 | 0 | 2,059 | 0 | 0 | 0 | 0 | 69 |
87e02e8e46132c97db5e7e96372e3d6b7ffa4c3f | 21,615 | py | Python | References/Original Docs/TrussCalc_v0.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2021-07-29T14:34:08.000Z | 2021-07-29T14:34:08.000Z | References/Original Docs/TrussCalc_v0.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2021-07-30T17:34:42.000Z | 2021-07-30T17:34:42.000Z | References/Original Docs/TrussCalc_v0.py | lorcan2440/SimpleTrussCalculator | 3c063fbc5f1987e9a700e312b763b36d4ec22495 | [
"MIT"
] | 1 | 2022-03-13T11:01:34.000Z | 2022-03-13T11:01:34.000Z |
# TRUSS INNER CLASSES END HERE
# MAIN FUNCTIONS END HERE
build_truss(815, True)
| 46.684665 | 152 | 0.556697 | from matplotlib import pyplot as plt
import math, sigfig, warnings # module "sigfig" requires "pip install sigfig" at command line
import numpy as np
def get_all_trusses():
return [truss for truss in Truss]
class IterTruss(type):
def __iter__(cls):
return iter(cls._allTrusses)
clas... | 14 | 0 | 0 | 14,868 | 0 | 6,352 | 0 | 20 | 278 |
0e2883fc0a40eaacd3d346a142bc2ccbdbc6a50c | 4,477 | py | Python | src/dual_gazebo/src/control_key_drive.py | diddytpq/Dual-Motion-robot-gazebo | 19d8098f9931ee7ded91f8242efdc176c418db8c | [
"MIT"
] | null | null | null | src/dual_gazebo/src/control_key_drive.py | diddytpq/Dual-Motion-robot-gazebo | 19d8098f9931ee7ded91f8242efdc176c418db8c | [
"MIT"
] | null | null | null | src/dual_gazebo/src/control_key_drive.py | diddytpq/Dual-Motion-robot-gazebo | 19d8098f9931ee7ded91f8242efdc176c418db8c | [
"MIT"
] | null | null | null | import rospy
import sys, os
import roslib
if os.name == 'nt':
else:
import termios
roslib.load_manifest('dual_gazebo')
if __name__ == '__main__':
try:
rospy.init_node('mecanum_key')
if os.name != 'nt':
settings = termios.tcgetattr(sys.stdin)
linear = [0, 0, 0]
... | 22.725888 | 110 | 0.542104 | import rospy
import numpy as np
from std_msgs.msg import Float64
from gazebo_msgs.srv import *
from geometry_msgs.msg import *
import sys, select, os
import roslib
if os.name == 'nt':
import msvcrt
else:
import tty, termios
roslib.load_manifest('dual_gazebo')
def qua2eular(x,y,z,w):
q_x = x
q_y = y
... | 0 | 0 | 0 | 0 | 0 | 2,630 | 0 | 31 | 250 |
316b321b9f7d046b9a1c73717ede0ee14f70b07e | 3,151 | py | Python | datalad/crawler/pipelines/tests/test_fcptable.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | null | null | null | datalad/crawler/pipelines/tests/test_fcptable.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 6 | 2015-11-20T21:41:13.000Z | 2018-06-12T14:27:32.000Z | datalad/crawler/pipelines/tests/test_fcptable.py | yarikoptic/datalad | c0cd538de2ed9a30c0f58256c7afa6e18d325505 | [
"MIT"
] | 1 | 2017-03-28T14:44:16.000Z | 2017-03-28T14:44:16.000Z | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 34.25 | 109 | 0.628689 | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 0 | 1,328 | 0 | 0 | 602 | 0 | 0 | 327 | 359 |
2adfa5603510b5c0ce9f049510e9539047f88898 | 1,683 | py | Python | KuldeepDwivedi_A2305218477/BFS/Water_jug.py | suraj0803/AI-LAB-WORK | c09776c104529678215d4f51a756ea0039a89df4 | [
"Apache-2.0"
] | null | null | null | KuldeepDwivedi_A2305218477/BFS/Water_jug.py | suraj0803/AI-LAB-WORK | c09776c104529678215d4f51a756ea0039a89df4 | [
"Apache-2.0"
] | null | null | null | KuldeepDwivedi_A2305218477/BFS/Water_jug.py | suraj0803/AI-LAB-WORK | c09776c104529678215d4f51a756ea0039a89df4 | [
"Apache-2.0"
] | null | null | null | # Water Jug problem
print("Solution for Water Jug problem!")
x = int(input("Enter the capacity of jug1 : "))
y = int(input("Entert the capacity of jug2 : "))
target = int(input("Enter the target volume : "))
start = [0, 0]
if target % gcd(x,y) == 0:
print(bfs(start, target, x, y))
else:
print("No so... | 25.892308 | 84 | 0.512181 | # Water Jug problem
print("Solution for Water Jug problem!")
x = int(input("Enter the capacity of jug1 : "))
y = int(input("Entert the capacity of jug2 : "))
target = int(input("Enter the target volume : "))
def bfs(start, target, x, y):
path = []
front = []
front.append(start)
visited = []
while(n... | 0 | 0 | 0 | 0 | 0 | 1,281 | 0 | 0 | 50 |
63865fa932487f27230a6778c7a192a4701cb3dc | 6,190 | py | Python | ReadStereoCalibration.py | cxn304/Strain-gauges-recognition | 1f9f64f8a0fa01892509835694ff88bc47736a7b | [
"Apache-2.0"
] | null | null | null | ReadStereoCalibration.py | cxn304/Strain-gauges-recognition | 1f9f64f8a0fa01892509835694ff88bc47736a7b | [
"Apache-2.0"
] | null | null | null | ReadStereoCalibration.py | cxn304/Strain-gauges-recognition | 1f9f64f8a0fa01892509835694ff88bc47736a7b | [
"Apache-2.0"
] | null | null | null | '''
author: cxn
version: 0.1.0
read camera calibration from mat
'''
import cv2
import matplotlib.pyplot as plt
#
#
def rectifyImage(image1, image2, map1x, map1y, map2x, map2y):
"""
cv2.remap,
"""
rectifyed_img1 = cv2.remap(image1, map1x, map1y, cv2.INTER_AREA)
rectifyed_img2 = cv2.remap(... | 32.578947 | 105 | 0.641034 | '''
author: cxn
version: 0.1.0
read camera calibration from mat
'''
import numpy as np
import cv2
from scipy.io import loadmat
import matplotlib.pyplot as plt
#双目相机参数
class stereoCameral(object):
def __init__(self):
stereoParameters = loadmat("./internal_reference/stereoParameters.mat")
self.cam... | 2,151 | 0 | 0 | 682 | 0 | 3,660 | 0 | 4 | 156 |
9789fa0d9128f43bf8dfdc8bf19f5e86479b11c4 | 2,110 | py | Python | lib/model/model.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | 2 | 2020-09-16T09:32:09.000Z | 2021-02-10T12:09:40.000Z | lib/model/model.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | null | null | null | lib/model/model.py | smallstrong0/easy_python | c6794bf290731beb9b3cab94f815880befb37d9b | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Put your models here
from lib.model.base import Base
"""
1. BaseModel
2. id
3.comment
4.
5.
"""
if __name__ == '__main__':
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import create_en... | 37.678571 | 122 | 0.735071 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Put your models here
from sqlalchemy import Column, BigInteger, Integer, String, SmallInteger, Float, Boolean, DECIMAL, Text, DateTime, Date, \
Index, UniqueConstraint
from sqlalchemy.dialects.mysql import MEDIUMTEXT, LONGTEXT, BIGINT, INTEGER, SMALLINT, TINYINT, T... | 360 | 0 | 0 | 1,066 | 0 | 0 | 0 | 281 | 157 |
7f00b4d7b1812863814e19a971adecf24942fc84 | 3,949 | py | Python | algorithms/Search.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | algorithms/Search.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | algorithms/Search.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Author: Zhao Xinlu
School: BUPT
Date: 2018-01-15
Function: Some different searching algorithms and its performance
"""
def Simple_search(lists, key):
'''
Simple_search: ;
O(n)
:param lists: search list
:param key: the value of key
:return: the key's location... | 26.326667 | 87 | 0.545455 | # -*- coding: utf-8 -*-
"""
Author: Zhao Xinlu
School: BUPT
Date: 2018-01-15
Function: Some different searching algorithms and its performance
"""
def Simple_search(lists, key):
'''
Simple_search: 数据不排序的线性查找,遍历数据元素;
性能:
时间复杂度:O(n)
:param lists: search list
:param key: the value of key
:... | 912 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d04e9753e38d729231b2e66b82bf461bc97df527 | 3,220 | py | Python | goldman/resources/oauth_ropc.py | sassoo/goldman | b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2 | [
"MIT"
] | 2 | 2016-07-26T13:47:51.000Z | 2017-02-13T12:08:38.000Z | goldman/resources/oauth_ropc.py | sassoo/goldman | b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2 | [
"MIT"
] | null | null | null | goldman/resources/oauth_ropc.py | sassoo/goldman | b72540c9ad06b5c68aadb1b4fa8cb0b716260bf2 | [
"MIT"
] | null | null | null | """
resources.oauth_ropc
~~~~~~~~~~~~~~~~~~~~
OAuth2 Resource Owner Password Credentials Grant resource
object with responders.
This resource should be used to accept access_token requests
according to RFC 6749 section 4.3:
tools.ietf.org/html/rfc6749#section-4.3
The resource req... | 32.857143 | 76 | 0.587888 | """
resources.oauth_ropc
~~~~~~~~~~~~~~~~~~~~
OAuth2 Resource Owner Password Credentials Grant resource
object with responders.
This resource should be used to accept access_token requests
according to RFC 6749 section 4.3:
tools.ietf.org/html/rfc6749#section-4.3
The resource req... | 0 | 149 | 0 | 2,257 | 0 | 0 | 0 | 39 | 113 |
6e976b5b835b38818090ff9810971809f857fe0e | 7,534 | py | Python | newapp.py | Andriusjok/VUSAMIFChatBot | 9444bcf4f0f2137757925f8e07b8cc3ba442a162 | [
"BSD-2-Clause"
] | null | null | null | newapp.py | Andriusjok/VUSAMIFChatBot | 9444bcf4f0f2137757925f8e07b8cc3ba442a162 | [
"BSD-2-Clause"
] | null | null | null | newapp.py | Andriusjok/VUSAMIFChatBot | 9444bcf4f0f2137757925f8e07b8cc3ba442a162 | [
"BSD-2-Clause"
] | null | null | null | from flask import Flask
ACCESS_TOKEN = "Baisiai slaptas"
VERIFY_TOKEN = "Dar slaptesnis"
app = Flask(__name__)
app.debug = True
messenger = Messenger(ACCESS_TOKEN)
if __name__ == "__main__":
app.run(host="0.0.0.0") | 41.395604 | 168 | 0.591585 | import os
from flask import Flask, request
from fbmessenger import BaseMessenger
from fbmessenger import quick_replies
from fbmessenger.elements import Text
from fbmessenger.thread_settings import GreetingText, GetStartedButton, MessengerProfile
from fbmessenger import elements
from fbmessenger import templates
ACCESS... | 56 | 381 | 0 | 6,566 | 0 | 0 | 0 | 135 | 200 |
788f66b9fb4748228011a407e6e029dba64a944b | 14,173 | py | Python | fixture/contact.py | Droriel/python_training | e0fbbf3df4289e5af606d9c752e99cab82c653a6 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | Droriel/python_training | e0fbbf3df4289e5af606d9c752e99cab82c653a6 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | Droriel/python_training | e0fbbf3df4289e5af606d9c752e99cab82c653a6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 46.621711 | 146 | 0.627672 | # -*- coding: utf-8 -*-
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from model.contact import ContactBaseData
import re
class ContactHelper:
def __init__(self, app):
self.app = app
# additional methods -adding contact
d... | 16 | 0 | 0 | 13,941 | 0 | 0 | 0 | 87 | 112 |
092f1761576ffa817c9655201b6f11db45a1a582 | 2,041 | py | Python | vision/library/tools/engines/text_recognition_tesseract.py | lcmonteiro/space-vision-py | 38022c99218de0e1e93ec0bae8d143fa0c787f1d | [
"MIT"
] | 1 | 2019-12-14T20:00:17.000Z | 2019-12-14T20:00:17.000Z | vision/library/tools/engines/text_recognition_tesseract.py | lcmonteiro/space-vision-py | 38022c99218de0e1e93ec0bae8d143fa0c787f1d | [
"MIT"
] | null | null | null | vision/library/tools/engines/text_recognition_tesseract.py | lcmonteiro/space-vision-py | 38022c99218de0e1e93ec0bae8d143fa0c787f1d | [
"MIT"
] | null | null | null | # ################################################################################################
# ------------------------------------------------------------------------------------------------
# File: text_recognition_tesseract_engine.py
# Author: Luis Monteiro
#
# Created on nov 17, 2019, 22:00 PM
# -----------... | 48.595238 | 98 | 0.168055 | # ################################################################################################
# ------------------------------------------------------------------------------------------------
# File: text_recognition_tesseract_engine.py
# Author: Luis Monteiro
#
# Created on nov 17, 2019, 22:00 PM
# -----------... | 0 | 0 | 0 | 630 | 0 | 0 | 0 | 18 | 44 |
5111b400d490cda967a1cc070c3b3f72a6cd1341 | 685 | py | Python | music_manuel/osc_server.py | HelsinkiGroup5/Hackathon | eb1c7c5f142fc3dbe83a41a558a1ab8071341d06 | [
"MIT"
] | null | null | null | music_manuel/osc_server.py | HelsinkiGroup5/Hackathon | eb1c7c5f142fc3dbe83a41a558a1ab8071341d06 | [
"MIT"
] | null | null | null | music_manuel/osc_server.py | HelsinkiGroup5/Hackathon | eb1c7c5f142fc3dbe83a41a558a1ab8071341d06 | [
"MIT"
] | null | null | null | import OSC
#import rtmidi_python as rtmidi
#midi_out = rtmidi.MidiOut()
#midi_out.open_port(0)
if __name__ == "__main__":
s = OSC.OSCServer(('10.100.7.151', 57120)) # listen on localhost, port 57120
s.addMsgHandler('/startup', handler) # call handler() for OSC messages received with the /startup address... | 29.782609 | 113 | 0.655474 | import OSC, time
#import rtmidi_python as rtmidi
#midi_out = rtmidi.MidiOut()
#midi_out.open_port(0)
def handler(addr, tags, data, client_address):
txt = "OSCMessage '%s' from %s: " % (addr, client_address)
txt += str(data)
print(txt)
#num = data[0]
#print num
#midi_out.send_message([0x90, 192... | 0 | 0 | 0 | 0 | 0 | 313 | 0 | 6 | 23 |
f1a11d584fb476bc84cfd89ab66c348ee5ba13cc | 24,531 | py | Python | store/adminshop/views/compras.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | store/adminshop/views/compras.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | store/adminshop/views/compras.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 28-Aug-2017
# @Email: valle.mrv@gmail.com
# @Filename: views.py
# @Last modified by: valle
# @Last modified time: 02-Mar-2018
# @License: Apache license vesion 2.0
try:
from django.core.urlresolvers import reverse
except ImportError:
#from d... | 40.148936 | 107 | 0.61832 | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 28-Aug-2017
# @Email: valle.mrv@gmail.com
# @Filename: views.py
# @Last modified by: valle
# @Last modified time: 02-Mar-2018
# @License: Apache license vesion 2.0
from django.forms.models import model_to_dict
from django.db.models import Q
fro... | 2 | 19,015 | 0 | 0 | 0 | 3,367 | 0 | 664 | 1,114 |
2a17da60768a072018629688624a0b3345cf9f9d | 16,285 | py | Python | tests/unit/test/plan/grammar/test_assertions.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 91 | 2017-05-08T22:41:33.000Z | 2022-02-09T11:37:07.000Z | tests/unit/test/plan/grammar/test_assertions.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 63 | 2017-06-14T20:08:49.000Z | 2021-06-16T23:08:25.000Z | tests/unit/test/plan/grammar/test_assertions.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 26 | 2017-10-13T23:23:13.000Z | 2022-01-11T16:58:17.000Z | from __future__ import (
absolute_import,
unicode_literals,
)
# noinspection PyTypeChecker
| 41.649616 | 120 | 0.55413 | from __future__ import (
absolute_import,
unicode_literals,
)
import unittest
from pysoa.common.errors import Error
from pysoa.test.plan.grammar import assertions
from pysoa.test.plan.grammar.data_types import AnyValue
# noinspection PyTypeChecker
class TestCustomAssertions(unittest.TestCase):
def test_... | 0 | 0 | 0 | 16,003 | 0 | 0 | 0 | 69 | 112 |
0ba1914cfcee88af2ca20a9d79b917b79305d0c5 | 5,248 | py | Python | lbry/tests/integration/test_wallet_server_sessions.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/tests/integration/test_wallet_server_sessions.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/tests/integration/test_wallet_server_sessions.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
| 39.458647 | 116 | 0.695122 | import asyncio
import socket
import time
import logging
from unittest.mock import Mock
from torba.testcase import IntegrationTestCase, Conductor
import lbry.wallet
from lbry.schema.claim import Claim
from lbry.wallet.transaction import Transaction, Output
from lbry.wallet.dewies import dewies_to_lbc as d2l, lbc_to_dewi... | 0 | 0 | 4,148 | 582 | 0 | 106 | 0 | 117 | 243 |
e76f76edb55be5c2cbb5a4d75f8d67fbe7d90f8d | 1,924 | py | Python | northwind.py | valogonor/DS-Unit-3-Sprint-2-SQL-and-Databases | 07c83195c4933d0ce02f431692fe970ef154cacf | [
"MIT"
] | null | null | null | northwind.py | valogonor/DS-Unit-3-Sprint-2-SQL-and-Databases | 07c83195c4933d0ce02f431692fe970ef154cacf | [
"MIT"
] | null | null | null | northwind.py | valogonor/DS-Unit-3-Sprint-2-SQL-and-Databases | 07c83195c4933d0ce02f431692fe970ef154cacf | [
"MIT"
] | null | null | null | import sqlite3
conn = sqlite3.connect('northwind_small.sqlite3')
curs = conn.cursor()
query = '''SELECT ProductName FROM Product
ORDER BY UnitPrice DESC
LIMIT 10'''
curs.execute(query)
results = curs.fetchall()
print('Ten most expensive items (per unit price):')
for result in results:
print(result[0])
query = '''S... | 30.539683 | 94 | 0.730249 | import sqlite3
conn = sqlite3.connect('northwind_small.sqlite3')
curs = conn.cursor()
query = '''SELECT ProductName FROM Product
ORDER BY UnitPrice DESC
LIMIT 10'''
curs.execute(query)
results = curs.fetchall()
print('Ten most expensive items (per unit price):')
for result in results:
print(result[0])
query = '''S... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6e666e5f27d346d3402248f6886267f86c56baa | 10,930 | py | Python | skfda/representation/basis/_basis.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | skfda/representation/basis/_basis.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | skfda/representation/basis/_basis.py | alejandro-ariza/scikit-fda | a3626eeaac81aac14660233ff7554ae9a1550434 | [
"BSD-3-Clause"
] | null | null | null | """Module for functional data manipulation in a basis system.
Defines functional data object in a basis function system representation and
the corresponding basis classes.
"""
| 30.788732 | 79 | 0.602928 | """Module for functional data manipulation in a basis system.
Defines functional data object in a basis function system representation and
the corresponding basis classes.
"""
import copy
import warnings
from abc import ABC, abstractmethod
from typing import Tuple
import numpy as np
from ..._utils import _domain_ra... | 0 | 446 | 0 | 9,876 | 0 | 174 | 0 | 52 | 202 |
833626e74d4e5013fbedd077febd8ce8f93d00fe | 2,613 | py | Python | 02-lm-tensorflow/loglin-lm.py | tinySean/nn4nlp-tensorflow | 17d64427ad3cf276f2d43eac706d14a6145cc3e6 | [
"Apache-2.0"
] | 2 | 2019-03-04T10:53:23.000Z | 2020-09-25T02:31:44.000Z | 02-lm-tensorflow/loglin-lm.py | tinySean/nn4nlp-tensorflow | 17d64427ad3cf276f2d43eac706d14a6145cc3e6 | [
"Apache-2.0"
] | null | null | null | 02-lm-tensorflow/loglin-lm.py | tinySean/nn4nlp-tensorflow | 17d64427ad3cf276f2d43eac706d14a6145cc3e6 | [
"Apache-2.0"
] | 1 | 2020-09-22T10:33:02.000Z | 2020-09-22T10:33:02.000Z | from collections import defaultdict
import math
import random
import tensorflow as tf
import numpy as np
# The length of the n-gram
N = 2
# Functions to read in the corpus
# NOTE: We are using data from the Penn Treebank, which is already converted
# into an easy-to-use format with "<unk>" symbols. If we were u... | 35.310811 | 115 | 0.654038 | from collections import defaultdict
import math
import time
import random
import tensorflow as tf
import numpy as np
# The length of the n-gram
N = 2
# Functions to read in the corpus
# NOTE: We are using data from the Penn Treebank, which is already converted
# into an easy-to-use format with "<unk>" symbols. ... | 0 | 0 | 0 | 0 | 112 | 0 | 0 | -10 | 44 |
d92e03bffe94661a767cf2e5a8765b439f90506e | 340 | py | Python | hgapp/powers/migrations/0015_remove_base_power_example_powers.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 6 | 2020-10-03T12:15:05.000Z | 2021-10-15T04:43:36.000Z | hgapp/powers/migrations/0015_remove_base_power_example_powers.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 99 | 2020-06-04T17:43:56.000Z | 2022-03-12T01:07:20.000Z | hgapp/powers/migrations/0015_remove_base_power_example_powers.py | shadytradesman/The-Contract-Website | d8b353064f91c53ebab951dec784a0a36caba260 | [
"Apache-2.0"
] | 9 | 2020-06-06T16:39:09.000Z | 2020-10-02T16:24:17.000Z | # Generated by Django 2.2.12 on 2020-08-02 14:03
| 18.888889 | 48 | 0.605882 | # Generated by Django 2.2.12 on 2020-08-02 14:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('powers', '0014_auto_20200731_1402'),
]
operations = [
migrations.RemoveField(
model_name='base_power',
name='example_powers... | 0 | 0 | 0 | 233 | 0 | 0 | 0 | 11 | 46 |
7465a346a19ecfbc1286a25f61bbc8e6e0865c9f | 201 | py | Python | tree.py | juhyun0/python_turtle2 | 59943c03a07a71aa33ab7124bca56f6b880b6883 | [
"Unlicense"
] | null | null | null | tree.py | juhyun0/python_turtle2 | 59943c03a07a71aa33ab7124bca56f6b880b6883 | [
"Unlicense"
] | null | null | null | tree.py | juhyun0/python_turtle2 | 59943c03a07a71aa33ab7124bca56f6b880b6883 | [
"Unlicense"
] | null | null | null |
t.left(90)
t.color("green")
t.speed(1)
tree(90)
| 11.823529 | 20 | 0.641791 | def tree(length):
if length>5:
t.forward(length)
t.right(20)
tree(length-15)
t.left(40)
tree(length-15)
t.right(20)
t.backward(length)
t.left(90)
t.color("green")
t.speed(1)
tree(90)
| 0 | 0 | 0 | 0 | 0 | 128 | 0 | 0 | 22 |
5f574b8c03d61700a6552dfc9ad0569e5c66bcbe | 3,648 | py | Python | model/genetic_model.py | abduskhazi/PL-Binding-Affinity-Prediction-using-ML | fe7172570fa378480455b4dcd214d0b0c4e94ff0 | [
"MIT"
] | 1 | 2021-12-07T09:00:01.000Z | 2021-12-07T09:00:01.000Z | model/genetic_model.py | abduskhazi/PL-Binding-Affinity-Prediction-using-ML | fe7172570fa378480455b4dcd214d0b0c4e94ff0 | [
"MIT"
] | null | null | null | model/genetic_model.py | abduskhazi/PL-Binding-Affinity-Prediction-using-ML | fe7172570fa378480455b4dcd214d0b0c4e94ff0 | [
"MIT"
] | null | null | null | # genetic algorithm search of the one max optimization problem
# objective function
# tournament selection
# crossover two parents to create two children
# mutation operator
# genetic algorithm
if False:
# define the total iterations
n_iter = 100
# bits
n_bits = 500 #20
# define the populati... | 34.415094 | 96 | 0.590186 | # genetic algorithm search of the one max optimization problem
from numpy.random import randint
from numpy.random import rand
import numpy as np
import json
# objective function
def onemax(x):
return -sum(x)
def sorted_population(pop, scores):
indices = scores.argsort()
sorted_pop = []
for i in indice... | 0 | 0 | 0 | 0 | 0 | 2,789 | 0 | 6 | 221 |
96164478cbee8505379a42f6487489b2e0b29439 | 7,588 | py | Python | dockerizing-django/web/joblistings/forms.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | 1 | 2021-06-14T06:54:16.000Z | 2021-06-14T06:54:16.000Z | joblistings/forms.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | 34 | 2020-04-05T01:14:31.000Z | 2022-03-12T00:23:02.000Z | joblistings/forms.py | MattYu/ConcordiaAce | 35eff7614652eb548e532dcf00e3a7296855285c | [
"MIT"
] | null | null | null | from joblistings.models import Job
from accounts.models import Employer
| 38.714286 | 183 | 0.649974 | from django import forms
from joblistings.models import Job
from accounts.models import Employer
from ace.constants import CATEGORY_CHOICES, MAX_LENGTH_TITLE, MAX_LENGTH_DESCRIPTION, MAX_LENGTH_RESPONSABILITIES, MAX_LENGTH_REQUIREMENTS, MAX_LENGTH_STANDARDFIELDS, LOCATION_CHOICES
from tinymce.widgets import TinyMCE
fro... | 0 | 0 | 0 | 7,046 | 0 | 0 | 0 | 266 | 204 |
dc39a84fe404c1eef75b6fc371c87b856fc55a84 | 500 | py | Python | run.py | nefeli/trafficgen | 81b6cb01d8e9d0abfcd83df641210035e265f13f | [
"BSD-3-Clause"
] | 10 | 2017-04-26T07:01:48.000Z | 2020-07-25T00:29:45.000Z | run.py | nefeli/trafficgen | 81b6cb01d8e9d0abfcd83df641210035e265f13f | [
"BSD-3-Clause"
] | 12 | 2017-03-21T17:58:16.000Z | 2017-10-16T18:01:37.000Z | run.py | nefeli/trafficgen | 81b6cb01d8e9d0abfcd83df641210035e265f13f | [
"BSD-3-Clause"
] | 5 | 2017-03-09T19:59:26.000Z | 2018-04-02T19:49:57.000Z | #!/usr/bin/env python3
import io
import sys
if __name__ == '__main__':
if len(sys.argv) == 1:
run_cli()
else:
cmds = []
line_buf = []
for arg in sys.argv[1:]:
if arg == '--':
cmds.append(' '.join(line_buf))
line_buf = []
e... | 20.833333 | 47 | 0.498 | #!/usr/bin/env python3
import io
import sys
import generator
from generator.cmdline import *
if __name__ == '__main__':
if len(sys.argv) == 1:
run_cli()
else:
cmds = []
line_buf = []
for arg in sys.argv[1:]:
if arg == '--':
cmds.append(' '.join(line... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 45 |
2d0afb7f18f7dfcc8cf1e3ca1087c009e3e728f5 | 974 | py | Python | scripts/genotype_from_fpaths.py | JIC-Image-Analysis/fishtools | 9d7cfa695711ec4b40986be65e11eea7ad1b0b5d | [
"MIT"
] | null | null | null | scripts/genotype_from_fpaths.py | JIC-Image-Analysis/fishtools | 9d7cfa695711ec4b40986be65e11eea7ad1b0b5d | [
"MIT"
] | null | null | null | scripts/genotype_from_fpaths.py | JIC-Image-Analysis/fishtools | 9d7cfa695711ec4b40986be65e11eea7ad1b0b5d | [
"MIT"
] | 1 | 2022-03-10T13:08:21.000Z | 2022-03-10T13:08:21.000Z |
if __name__ == "__main__":
main()
| 20.723404 | 60 | 0.666324 | import os
import pathlib
import click
import parse
from fishtools.config import Config
def is_image(filename, image_exts=['.czi']):
_, ext = os.path.splitext(filename)
return ext in image_exts
@click.command()
@click.argument('config_fpath')
def main(config_fpath):
config = Config(config_fpath)
... | 0 | 701 | 0 | 0 | 0 | 94 | 0 | -23 | 158 |
052f73c51d8e906ef7280490bdcc2bd79bb64740 | 4,643 | py | Python | list_id_bimap.py | martincochran/score-minion | 58197798a0a3a4fbcd54ffa0a2fab2e865985bfd | [
"Apache-2.0"
] | null | null | null | list_id_bimap.py | martincochran/score-minion | 58197798a0a3a4fbcd54ffa0a2fab2e865985bfd | [
"Apache-2.0"
] | 3 | 2015-02-15T18:31:10.000Z | 2015-02-22T19:56:05.000Z | list_id_bimap.py | martincochran/score-minion | 58197798a0a3a4fbcd54ffa0a2fab2e865985bfd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2015 Martin Cochran
#
# 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 la... | 31.80137 | 92 | 0.713117 | #!/usr/bin/env python
#
# Copyright 2015 Martin Cochran
#
# 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 la... | 0 | 1,281 | 0 | 2,595 | 0 | 0 | 0 | 51 | 112 |
468ad4ffeae4e5171b0014bec49676ed9cc8da05 | 2,988 | py | Python | loralos/wms_image.py | SimonLarsen/loralos | 198a6b94a984f12e7a069826e3f977db9de34d00 | [
"MIT"
] | null | null | null | loralos/wms_image.py | SimonLarsen/loralos | 198a6b94a984f12e7a069826e3f977db9de34d00 | [
"MIT"
] | null | null | null | loralos/wms_image.py | SimonLarsen/loralos | 198a6b94a984f12e7a069826e3f977db9de34d00 | [
"MIT"
] | null | null | null |
FORMAT_ENDINGS = {"image/jpeg": "jpg"}
| 30.489796 | 78 | 0.522758 | from owslib.wms import WebMapService
import pyproj
from PIL import Image
from typing import Tuple, List, Dict, Any
import os.path
from pathlib import Path
FORMAT_ENDINGS = {"image/jpeg": "jpg"}
class WMSImage:
def __init__(
self,
url: str,
layer: str,
cache_dir: str,
styl... | 0 | 0 | 0 | 2,768 | 0 | 0 | 0 | 23 | 155 |
1acaf21ff5c98fb66692384b82ca684a87d4e348 | 5,004 | py | Python | mail/gmailapi.py | prabin-acharya/mail-Gmail | b39bfbd48fedcd3e2a101cd0d2d4c3302faa233d | [
"MIT"
] | 1 | 2021-08-08T04:02:32.000Z | 2021-08-08T04:02:32.000Z | mail/gmailapi.py | prabin-acharya/mail-Gmail | b39bfbd48fedcd3e2a101cd0d2d4c3302faa233d | [
"MIT"
] | null | null | null | mail/gmailapi.py | prabin-acharya/mail-Gmail | b39bfbd48fedcd3e2a101cd0d2d4c3302faa233d | [
"MIT"
] | null | null | null | from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token.json.
SCOPES =... | 31.872611 | 118 | 0.607314 | from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
import time
from email.mime.text import MIMEText
from .models imp... | 0 | 0 | 0 | 0 | 0 | 3,540 | 0 | -46 | 339 |
3c5b5a01aea276ed55213cc1efedac91d26ae1c8 | 1,580 | py | Python | diagrams/ibm/blockchain.py | houmam/diagrams | eaf3e98304014e847c347bfae19bbfb3fe91abb2 | [
"MIT"
] | 17,037 | 2020-02-03T01:30:30.000Z | 2022-03-31T18:09:15.000Z | diagrams/ibm/blockchain.py | loftwah/diagrams | e45804b48d5360fe5bae1b785db6527db5a57d16 | [
"MIT"
] | 529 | 2020-02-03T10:43:41.000Z | 2022-03-31T17:33:08.000Z | diagrams/ibm/blockchain.py | loftwah/diagrams | e45804b48d5360fe5bae1b785db6527db5a57d16 | [
"MIT"
] | 1,068 | 2020-02-05T11:54:29.000Z | 2022-03-30T23:28:55.000Z | # This module is automatically generated by autogen.sh. DO NOT EDIT.
# Aliases
| 17.173913 | 68 | 0.728481 | # This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _IBM
class _Blockchain(_IBM):
_type = "blockchain"
_icon_dir = "resources/ibm/blockchain"
class BlockchainDeveloper(_Blockchain):
_icon = "blockchain-developer.png"
class Blockchain(_Blockchain):
_icon = "blockchai... | 0 | 0 | 0 | 975 | 0 | 0 | 0 | -3 | 506 |
f353ecb9975a775e9ee105aa31a7468ed23f0c58 | 1,634 | py | Python | sp/test_remap.py | crepuscularlight/SemesterProject | acfb219ca315d912b76bb581b932aaf48090fa94 | [
"MIT"
] | null | null | null | sp/test_remap.py | crepuscularlight/SemesterProject | acfb219ca315d912b76bb581b932aaf48090fa94 | [
"MIT"
] | null | null | null | sp/test_remap.py | crepuscularlight/SemesterProject | acfb219ca315d912b76bb581b932aaf48090fa94 | [
"MIT"
] | null | null | null | _base_='../swin/mask_rcnn_swin-t-p4-w7_fpn_1x_coco.py'
dataset_type='CocoDataset'
prefix='../coco-annotator/datasets/test/'
classes=('plasticbottle','alu can','box')
# classes=('',)
model = dict(
roi_head=dict(
bbox_head=dict(num_classes=3),
mask_head=dict(num_classes=3)))
# train_pipeline = [
# ... | 29.178571 | 79 | 0.612607 | _base_='../swin/mask_rcnn_swin-t-p4-w7_fpn_1x_coco.py'
dataset_type='CocoDataset'
prefix='../coco-annotator/datasets/test/'
classes=('plasticbottle','alu can','box')
# classes=('',)
model = dict(
roi_head=dict(
bbox_head=dict(num_classes=3),
mask_head=dict(num_classes=3)))
# train_pipeline = [
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd903e7ade80030c34ceee4d669a0b45dddb9daa | 5,234 | py | Python | flickipedia/mysqlio.py | rfaulkner/Flickipedia | 1b53f30be4027901748a09c411d568c7148f4e4b | [
"BSD-2-Clause"
] | 1 | 2016-03-11T09:40:19.000Z | 2016-03-11T09:40:19.000Z | flickipedia/mysqlio.py | rfaulkner/Flickipedia | 1b53f30be4027901748a09c411d568c7148f4e4b | [
"BSD-2-Clause"
] | 1 | 2015-02-27T02:23:19.000Z | 2015-02-27T02:23:19.000Z | flickipedia/mysqlio.py | rfaulkner/Flickipedia | 1b53f30be4027901748a09c411d568c7148f4e4b | [
"BSD-2-Clause"
] | null | null | null | """
Handle MySQL I/O via sqlalchemy engine and ORM
"""
| 28.601093 | 88 | 0.526557 | """
Handle MySQL I/O via sqlalchemy engine and ORM
"""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from flickipedia.config import schema
from flickipedia.config import log, settings
class DataIOMySQL(object):
""" Class implementing data IO for MySQL. Utilizes sqlalchemy [1].
... | 0 | 36 | 0 | 4,957 | 0 | 0 | 0 | 72 | 113 |
4af99f0e08de844feaa37c0def95f861de377265 | 1,158 | py | Python | pepdb/tasks/migrations/0025_auto_20171022_0208.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 7 | 2015-12-21T03:52:46.000Z | 2020-07-24T19:17:23.000Z | pepdb/tasks/migrations/0025_auto_20171022_0208.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 12 | 2016-03-05T18:11:05.000Z | 2021-06-17T20:20:03.000Z | pepdb/tasks/migrations/0025_auto_20171022_0208.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 4 | 2016-07-17T20:19:38.000Z | 2021-03-23T12:47:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-21 23:08
from __future__ import unicode_literals
| 27.571429 | 118 | 0.632988 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-21 23:08
from __future__ import unicode_literals
from django.db import migrations
def count_connections(p):
return p.person2company_set.count() + p.from_persons.count() + p.person2country_set.count() + p.to_persons.count()
def delete_stuck_orphans... | 0 | 0 | 0 | 167 | 0 | 772 | 0 | 11 | 92 |
ce94a6e9468ca1ec3c62b98a42a762f04ebc1840 | 182 | py | Python | tests/test_patient.py | genghisken/python-intermediate-inflammation | dc16cfb5824a713e8881dba1116f607793dd5f4c | [
"MIT"
] | null | null | null | tests/test_patient.py | genghisken/python-intermediate-inflammation | dc16cfb5824a713e8881dba1116f607793dd5f4c | [
"MIT"
] | 20 | 2021-12-10T10:36:32.000Z | 2021-12-10T12:46:34.000Z | code/poetry_project/tests/test_patient.py | SABS-R3/software-engineering-day4 | d73cc72786fceb236cd1ec33e900e482fbad08d4 | [
"CC-BY-4.0"
] | 1 | 2021-12-10T11:54:57.000Z | 2021-12-10T11:54:57.000Z | """Tests for the Patient model."""
| 16.545455 | 43 | 0.659341 | """Tests for the Patient model."""
def test_create_patient():
from inflammation.models import Patient
name = 'Alice'
p = Patient(name=name)
assert p.name == name
| 0 | 0 | 0 | 0 | 0 | 123 | 0 | 0 | 23 |
270ceac1e816bd1486bca6f8ee6231afb3d168fa | 6,299 | py | Python | PT2022_0412_1716_simpler_keys.py | O8pen/PhraseTranslate | 62e657d1e58ab36df27f181f51410840526e939f | [
"Apache-2.0"
] | null | null | null | PT2022_0412_1716_simpler_keys.py | O8pen/PhraseTranslate | 62e657d1e58ab36df27f181f51410840526e939f | [
"Apache-2.0"
] | null | null | null | PT2022_0412_1716_simpler_keys.py | O8pen/PhraseTranslate | 62e657d1e58ab36df27f181f51410840526e939f | [
"Apache-2.0"
] | null | null | null | # Python 3.7.9
# pip install clipboard
# pip install pywin32
# pip install pyautogui
# pip install pynput
# Google chrome Keyboard Shortcuts for Google Translate https://chrome.google.com/webstore/detail/keyboard-shortcuts-for-go/akjhnbnjanndggbcegmdggfjjclohjpo
# alt+j listen google translate
# Google chrome Dark Re... | 27.627193 | 156 | 0.589459 | # Python 3.7.9
# pip install clipboard
# pip install pywin32
# pip install pyautogui
# pip install pynput
# Google chrome Keyboard Shortcuts for Google Translate https://chrome.google.com/webstore/detail/keyboard-shortcuts-for-go/akjhnbnjanndggbcegmdggfjjclohjpo
# alt+j listen google translate
# Google chrome Dark Re... | 6 | 0 | 0 | 0 | 0 | 4,884 | 0 | 90 | 272 |
77826738beb692c3294e0414b44a66d2c7706884 | 1,019 | py | Python | Python/SwapNodesInPairs.py | TonnyL/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 205 | 2017-11-16T08:38:46.000Z | 2022-03-06T05:50:03.000Z | Python/SwapNodesInPairs.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 3 | 2018-04-10T10:17:52.000Z | 2020-12-11T08:00:09.000Z | Python/SwapNodesInPairs.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 28 | 2018-04-10T06:42:42.000Z | 2021-09-14T14:15:39.000Z | # -*- coding: UTF-8 -*-
#
# Given a linked list, swap every two adjacent nodes and return its head.
#
# For example,
# Given 1->2->3->4, you should return the list as 2->1->4->3.
#
# Your algorithm should use only constant space. You may not modify the values in the list, only nodes itself can be changed.
#
# Python, P... | 24.261905 | 125 | 0.56526 | # -*- coding: UTF-8 -*-
#
# Given a linked list, swap every two adjacent nodes and return its head.
#
# For example,
# Given 1->2->3->4, you should return the list as 2->1->4->3.
#
# Your algorithm should use only constant space. You may not modify the values in the list, only nodes itself can be changed.
#
# Python, P... | 0 | 0 | 0 | 630 | 0 | 0 | 0 | 0 | 46 |
5bf1138dbd9cc41844dc6aff07cb5e59592dbe1a | 7,238 | py | Python | vaelib/avb.py | rnagumo/vaelib | 9505a62e07f539df1a94f1ac7e9ada694df62844 | [
"MIT"
] | 1 | 2021-11-12T14:25:05.000Z | 2021-11-12T14:25:05.000Z | vaelib/avb.py | rnagumo/vaelib | 9505a62e07f539df1a94f1ac7e9ada694df62844 | [
"MIT"
] | null | null | null | vaelib/avb.py | rnagumo/vaelib | 9505a62e07f539df1a94f1ac7e9ada694df62844 | [
"MIT"
] | 1 | 2021-12-30T12:30:53.000Z | 2021-12-30T12:30:53.000Z | """Adversarial Variational Bayes (AVB).
Adversarial Variational Bayes: Unifying Variational Autoencoders and Generative
Adversarial Networks
http://arxiv.org/abs/1701.04722
Ref)
https://github.com/gdikov/adversarial-variational-bayes
http://seiya-kumada.blogspot.com/2018/07/adversarial-variational-bayes.html
https://... | 28.496063 | 160 | 0.553606 | """Adversarial Variational Bayes (AVB).
Adversarial Variational Bayes: Unifying Variational Autoencoders and Generative
Adversarial Networks
http://arxiv.org/abs/1701.04722
Ref)
https://github.com/gdikov/adversarial-variational-bayes
http://seiya-kumada.blogspot.com/2018/07/adversarial-variational-bayes.html
https://... | 0 | 0 | 0 | 6,470 | 0 | 0 | 0 | 46 | 183 |
989d84ba9d1966b892115c10525a944d80912f4e | 4,884 | py | Python | boards/apollo2_evb/examples/multi_boot_secure_sample/generate_secureboot_assets.py | wher0001/AmbiqSuiteSDK | e280cbde3e366509da6768ab95471782a05d2371 | [
"BSD-3-Clause"
] | 25 | 2019-09-26T18:30:40.000Z | 2022-01-21T07:42:04.000Z | boards/apollo2_evb/examples/multi_boot_secure_sample/generate_secureboot_assets.py | vaxradius/AmbiqSuite-R2.4.2 | 0ffd4a67ec6b63512f56556c40fe6ee4ded1a569 | [
"BSD-3-Clause"
] | 23 | 2020-01-20T17:25:02.000Z | 2021-11-16T21:06:42.000Z | boards/apollo2_evb/examples/multi_boot_secure_sample/generate_secureboot_assets.py | vaxradius/AmbiqSuite-R2.4.2 | 0ffd4a67ec6b63512f56556c40fe6ee4ded1a569 | [
"BSD-3-Clause"
] | 23 | 2020-04-04T18:35:35.000Z | 2022-03-15T07:34:02.000Z | #!/usr/bin/env python3
import argparse
# This key table has to match the one in bootloader
keyTbl = [0xDEADBEEF, 0xAAAAAAAA, 0x11111111, 0x00000000, 0xFFFFFFFF, 0x55555555, 0xA5A5A5A5, 0x66666666]
#******************************************************************************
#
# Main function
#
#*******************... | 33.452055 | 115 | 0.546683 | #!/usr/bin/env python3
import argparse
import sys
import os
# This key table has to match the one in bootloader
keyTbl = [0xDEADBEEF, 0xAAAAAAAA, 0x11111111, 0x00000000, 0xFFFFFFFF, 0x55555555, 0xA5A5A5A5, 0x66666666]
#******************************************************************************
#
# Main function
#... | 0 | 0 | 0 | 0 | 0 | 2,644 | 0 | -23 | 201 |
0496b97a9bf1fb8fa8146228a03e548726184666 | 1,303 | py | Python | backend/api/views.py | trib3/django-vue-vuetify-toy | b73fe31acf989b63511bf1779695912257c88cf2 | [
"MIT"
] | null | null | null | backend/api/views.py | trib3/django-vue-vuetify-toy | b73fe31acf989b63511bf1779695912257c88cf2 | [
"MIT"
] | null | null | null | backend/api/views.py | trib3/django-vue-vuetify-toy | b73fe31acf989b63511bf1779695912257c88cf2 | [
"MIT"
] | null | null | null | from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
from django.db.models import Count, Sum
from django.db.models.functions import Coalesce
from backend.api.models import Profile, ProfileDisplayFields, PostAggregateFields
from django.http import JsonResponse
from django.h... | 30.302326 | 82 | 0.653876 | from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
from django.db.models import Count, Sum
from django.db.models.functions import Coalesce
from backend.api.models import Profile, ProfileDisplayFields, PostAggregateFields
from django.http import JsonResponse
from django.h... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
512587114336c35d6dc9c508ffa136085e46b053 | 2,295 | py | Python | submission/id/models.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | submission/id/models.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | submission/id/models.py | simonprast/wopi-engine | b3f59782659c8be42f4064bce5281afd391833be | [
"BSD-Source-Code"
] | null | null | null | #
# Created on Wed Nov 18 2020
#
# Copyright (c) 2020 - Simon Prast
#
| 25.786517 | 71 | 0.651852 | #
# Created on Wed Nov 18 2020
#
# Copyright (c) 2020 - Simon Prast
#
import os
import uuid
from django.conf import settings
from django.db import models
from user.models import User
class IDSubmissionManager(models.Manager):
def create_submission(self, submitter, document, document_back):
id_submissi... | 0 | 0 | 0 | 1,856 | 0 | 156 | 0 | 3 | 205 |
54229d5bb24d7ad6c282137584e0947395e03605 | 418 | py | Python | Session_01/py101/10_classes.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | 9 | 2020-06-05T17:01:23.000Z | 2022-03-16T19:55:50.000Z | Session_01/py101/10_classes.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | null | null | null | Session_01/py101/10_classes.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | 2 | 2020-02-20T16:48:35.000Z | 2020-03-18T14:36:04.000Z |
p1 = People("Maria", 1999)
print(p1.name)
print(p1.birthYear)
print(p1.age)
p1.pillar = "Architecture and Sustainable Design (ASD)"
print(f"{p1.name} is {p1.age} years old, and she is majored in {p1.pillar}")
| 23.222222 | 76 | 0.645933 | class People:
def __init__(self, name, birthYear):
self.name = name
self.birthYear = birthYear
self.age = 2020 - birthYear
self.height = None
self.pillar = None
p1 = People("Maria", 1999)
print(p1.name)
print(p1.birthYear)
print(p1.age)
p1.pillar = "Architecture and Sustai... | 0 | 0 | 0 | 183 | 0 | 0 | 0 | 0 | 22 |
1f913af634f48374288edbe27e053cffc84d41af | 4,845 | py | Python | tests/functional/commands/test_list_command.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 4 | 2019-09-02T19:41:04.000Z | 2020-04-07T13:05:47.000Z | tests/functional/commands/test_list_command.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2018-06-26T19:17:09.000Z | 2022-02-23T13:40:04.000Z | tests/functional/commands/test_list_command.py | aimar1986bupt/orion | 6d217af1f9002aa671f8a3260a687c540ca5336d | [
"BSD-3-Clause"
] | 2 | 2019-08-26T11:36:47.000Z | 2020-04-07T13:05:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Perform a functional test of the list command."""
import os
import orion.core.cli
def test_no_exp(monkeypatch, clean_db, capsys):
"""Test that nothing is printed when there are no experiments."""
monkeypatch.chdir(os.path.dirname(os.path.abspath(__file__)))
... | 30.664557 | 100 | 0.685449 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Perform a functional test of the list command."""
import os
import orion.core.cli
def test_no_exp(monkeypatch, clean_db, capsys):
"""Test that nothing is printed when there are no experiments."""
monkeypatch.chdir(os.path.dirname(os.path.abspath(__file__)))
... | 45 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
94f35cf52b9ed17eeeb19e3cea45eb8e5993057c | 6,441 | py | Python | video_test.py | SteveSZF/Traffic-Lane-Detection | 8217808178cdf2d655d02632eb71c543d39f5258 | [
"MIT"
] | 2 | 2019-10-08T08:52:43.000Z | 2019-10-08T08:55:37.000Z | video_test.py | SteveSZF/Traffic-Lane-Detection | 8217808178cdf2d655d02632eb71c543d39f5258 | [
"MIT"
] | null | null | null | video_test.py | SteveSZF/Traffic-Lane-Detection | 8217808178cdf2d655d02632eb71c543d39f5258 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 43.816327 | 164 | 0.604409 | import argparse
import os
import numpy as np
from tqdm import tqdm
from mypath import Path
from dataloaders import make_data_loader
from modeling.sync_batchnorm.replicate import patch_replication_callback
from modeling.erfnet_road import *
from utils.loss import SegmentationLosses
from utils.calculate_weights import c... | 0 | 0 | 0 | 2,702 | 0 | 3,052 | 0 | 250 | 399 |
b72f0aa5b11153c3e11b4251b59096cbdc84677d | 128 | py | Python | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_0/_pkg0_1_0_0/_pkg0_1_0_0_0/_mod0_1_0_0_0_3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_0/_pkg0_1_0_0/_pkg0_1_0_0_0/_mod0_1_0_0_0_3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_0/_pkg0_1_0_0/_pkg0_1_0_0_0/_mod0_1_0_0_0_3.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | name0_1_0_0_0_3_0 = None
name0_1_0_0_0_3_1 = None
name0_1_0_0_0_3_2 = None
name0_1_0_0_0_3_3 = None
name0_1_0_0_0_3_4 = None | 14.222222 | 24 | 0.820313 | name0_1_0_0_0_3_0 = None
name0_1_0_0_0_3_1 = None
name0_1_0_0_0_3_2 = None
name0_1_0_0_0_3_3 = None
name0_1_0_0_0_3_4 = None | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5bc3308252b8c656c9f2d85675cb4f58fd8d48c6 | 1,440 | py | Python | covertCSVtoData.py | kobe41999/ASUS_ECG | 0e20ccc92ade8130fe4a8ace3c6ef2e910631376 | [
"MIT"
] | null | null | null | covertCSVtoData.py | kobe41999/ASUS_ECG | 0e20ccc92ade8130fe4a8ace3c6ef2e910631376 | [
"MIT"
] | null | null | null | covertCSVtoData.py | kobe41999/ASUS_ECG | 0e20ccc92ade8130fe4a8ace3c6ef2e910631376 | [
"MIT"
] | null | null | null | import csv
import pandas as pd
from sklearn import preprocessing
import numpy as np
if __name__ == '__main__':
df = pd.read_csv('./JsonToCSV/data0126.csv')
ecgList = []
recordLen = 10000
for i in range(len(df.ECG)):
ecgList.append(changeToList(df.ECG[i].split(" ")))
for j in range(len(ec... | 27.692308 | 94 | 0.584722 | import csv
import config as C
import pandas as pd
from sklearn import preprocessing
import numpy as np
def changeToList(data):
dataList = []
first = data[0].replace("['", "")
dataList.append(first)
for i in range(len(data) - 3):
dataList.append(data[i + 1])
last = data[len(data) - 1].rep... | 60 | 0 | 0 | 0 | 0 | 255 | 0 | -3 | 45 |
0f98aaa91b5b977fd6d211f7d9569c79ce941321 | 597 | py | Python | Challenges/Quartiles.py | adarsh2104/Hacker-Rank-Days-of-Statistics | 30a1c56dc69ae0a98c09e5075f9b6dd0b747e0f9 | [
"MIT"
] | 2 | 2021-02-26T14:28:08.000Z | 2021-02-26T18:51:51.000Z | Challenges/Quartiles.py | adarsh2104/Hacker-Rank-Days-of-Statistics | 30a1c56dc69ae0a98c09e5075f9b6dd0b747e0f9 | [
"MIT"
] | null | null | null | Challenges/Quartiles.py | adarsh2104/Hacker-Rank-Days-of-Statistics | 30a1c56dc69ae0a98c09e5075f9b6dd0b747e0f9 | [
"MIT"
] | null | null | null |
# Github : https://github.com/adarsh2104
# HR-Profile: https://www.hackerrank.com/adarsh_2104
# Challenge : https://www.hackerrank.com/challenges/s10-quartiles
# Max Score : 30
n = input()
input_array = sorted([int(x) for x in input().split()])
print(find_median(input_array[:len(input_array)//2]))
print(fin... | 28.428571 | 78 | 0.658291 |
# Github : https://github.com/adarsh2104
# HR-Profile: https://www.hackerrank.com/adarsh_2104
# Challenge : https://www.hackerrank.com/challenges/s10-quartiles
# Max Score : 30
def find_median(array):
if len(array) % 2 == 1:
return array[len(array) // 2]
else:
return (array[len(array)... | 0 | 0 | 0 | 0 | 0 | 152 | 0 | 0 | 23 |
586635bed9aefd8fbc1c66989b9458a4ab61adfe | 1,945 | py | Python | corehq/apps/export/det/base.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/export/det/base.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/export/det/base.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z |
TITLE_ROW = [
'Source Field',
'Field',
'Map Via',
'Data Source',
'Filter Name',
'Filter Value',
'Table Name',
'Format Via',
]
| 24.935897 | 83 | 0.521337 | import attr
from couchexport.export import export_raw
from couchexport.models import Format
TITLE_ROW = [
'Source Field',
'Field',
'Map Via',
'Data Source',
'Filter Name',
'Filter Value',
'Table Name',
'Format Via',
]
@attr.s
class DETConfig:
name = attr.ib()
tables = attr.ib... | 0 | 1,621 | 0 | 0 | 0 | 0 | 0 | 26 | 136 |
87eb59f5bcf3a945fa6fe34538a2552cbcaa1241 | 2,241 | py | Python | wayne/trend_generators/visit_trends.py | ucl-exoplanets/wayne | 48fd07588cbbab6f5a32038455e36d7fc6b89625 | [
"MIT"
] | 7 | 2017-05-30T09:01:50.000Z | 2019-04-05T05:46:23.000Z | wayne/trend_generators/visit_trends.py | ucl-exoplanets/wayne | 48fd07588cbbab6f5a32038455e36d7fc6b89625 | [
"MIT"
] | 1 | 2018-06-07T17:31:19.000Z | 2018-06-07T19:38:27.000Z | wayne/trend_generators/visit_trends.py | ucl-exoplanets/wayne | 48fd07588cbbab6f5a32038455e36d7fc6b89625 | [
"MIT"
] | 2 | 2018-04-30T23:16:22.000Z | 2020-09-30T18:12:47.000Z | """ Handles visit long trends (scaling factors) applied to the observation. The
classic cases are the `hook' and long term ramp
"""
import numpy as np
def gen_orbit_start_times_per_exp(time_array, obs_start_index):
"""Generates t0, the time of an orbit for each orbit so it can vectorised
i.e for each elem... | 30.283784 | 86 | 0.671129 | """ Handles visit long trends (scaling factors) applied to the observation. The
classic cases are the `hook' and long term ramp
"""
import abc
import numpy as np
class BaseVisitTrend(object):
""" Visit trends take input the visit planner output and generate a
scaling factor that will be multiplied per expos... | 0 | 551 | 0 | 973 | 0 | 0 | 0 | -11 | 69 |
20b20caa6fbb670cc141c57bc10a431f41d617b3 | 14,975 | py | Python | ietf/meeting/migrations/0011_ietf92_meetings.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:40.000Z | 2021-11-20T03:40:42.000Z | ietf/meeting/migrations/0011_ietf92_meetings.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/meeting/migrations/0011_ietf92_meetings.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 76.403061 | 152 | 0.482204 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations
def backfill_92_other_meetings(apps, schema_editor):
Meeting = apps.get_model('meeting', 'Meeting')
Schedule = apps.get_model('meeting', 'Schedule')
ScheduledSess... | 0 | 0 | 0 | 320 | 0 | 14,493 | 0 | 5 | 91 |
5d8f36982b929c47137cde1f262689332f36b121 | 26,755 | py | Python | pipelines/create_trackhub_for_project.py | PRIDE-Toolsuite/trackhub-creator | ade2cfafeaad95088664caecacb783b501c170aa | [
"Apache-2.0"
] | null | null | null | pipelines/create_trackhub_for_project.py | PRIDE-Toolsuite/trackhub-creator | ade2cfafeaad95088664caecacb783b501c170aa | [
"Apache-2.0"
] | null | null | null | pipelines/create_trackhub_for_project.py | PRIDE-Toolsuite/trackhub-creator | ade2cfafeaad95088664caecacb783b501c170aa | [
"Apache-2.0"
] | null | null | null | #
# Author: Manuel Bernal Llinares
# Project: trackhub-creator
# Timestamp : 07-09-2017 11:24
# ---
# 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This pipeline creates a trackhub for a PRIDE project, based on the information provided via a JSON formatted file, as it
can be seen on ... | 50.196998 | 120 | 0.676808 | #
# Author : Manuel Bernal Llinares
# Project : trackhub-creator
# Timestamp : 07-09-2017 11:24
# ---
# © 2017 Manuel Bernal Llinares <mbdebian@gmail.com>
# All rights reserved.
#
"""
This pipeline creates a trackhub for a PRIDE project, based on the information provided via a JSON formatted file, as it
can be ... | 16 | 0 | 0 | 23,944 | 0 | 717 | 0 | 186 | 425 |
b76df0159986f1a2e79043c17c75ba6fb06ea156 | 8,516 | py | Python | tests/extractors/test_protein.py | KalinNonchev/kipoiseq | 38d1134885e401198acd3883286dc55627cf12a6 | [
"MIT"
] | 2 | 2019-12-16T17:13:04.000Z | 2021-07-29T12:05:47.000Z | tests/extractors/test_protein.py | KalinNonchev/kipoiseq | 38d1134885e401198acd3883286dc55627cf12a6 | [
"MIT"
] | 117 | 2020-04-22T12:46:45.000Z | 2021-08-02T04:40:58.000Z | tests/extractors/test_protein.py | KalinNonchev/kipoiseq | 38d1134885e401198acd3883286dc55627cf12a6 | [
"MIT"
] | null | null | null | from kipoiseq.dataclasses import Interval
gtf_file = 'tests/data/sample_1_protein.gtf'
fasta_file = 'tests/data/demo_dna_seq.fa'
transcript_id = 'enst_test1'
vcf_file = 'tests/data/singleVar_vcf_enst_test2.vcf.gz'
intervals = [
Interval('22', 580, 596, strand='+', attrs={'tag': 'cds_end_NF'}),
Interval('22',... | 31.308824 | 99 | 0.705965 | import pytest
from pytest_mock import mocker
import pandas as pd
from kipoiseq.transforms.functional import translate, rc_dna
from kipoiseq.dataclasses import Interval, Variant
from kipoiseq.extractors.protein import cut_transcript_seq, gtf_row2interval, \
CDSFetcher, TranscriptSeqExtractor, ProteinSeqExtractor, \
... | 0 | 743 | 0 | 0 | 0 | 6,400 | 0 | 271 | 616 |
eed5699e06d3cac61b4a945b53a1004046c608f3 | 1,026 | py | Python | task3/task3.py | ksmirenko/ml-homework | a5e558352ffc332ad5e40526dda21f205718a203 | [
"MIT"
] | 1 | 2020-08-05T08:06:33.000Z | 2020-08-05T08:06:33.000Z | task3/task3.py | ksmirenko/ml-homework | a5e558352ffc332ad5e40526dda21f205718a203 | [
"MIT"
] | null | null | null | task3/task3.py | ksmirenko/ml-homework | a5e558352ffc332ad5e40526dda21f205718a203 | [
"MIT"
] | null | null | null |
# Works when launched from terminal
# noinspection PyUnresolvedReferences
input_image_file = 'lena.jpg'
output_image_prefix = 'out_lena'
n_clusters = [2, 3, 5]
max_iterations = 100
launch_count = 3
main()
| 27.72973 | 104 | 0.692008 | from PIL import Image
import numpy as np
# Works when launched from terminal
# noinspection PyUnresolvedReferences
from k_means import k_means
input_image_file = 'lena.jpg'
output_image_prefix = 'out_lena'
n_clusters = [2, 3, 5]
max_iterations = 100
launch_count = 3
def main():
# Read input image
image = np... | 0 | 0 | 0 | 0 | 0 | 724 | 0 | 3 | 89 |
4029817dc33967552ae1824d14039c95b823fc6b | 12,289 | py | Python | neural_guided_symbolic_regression/models/mcts.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | neural_guided_symbolic_regression/models/mcts.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 7 | 2021-11-10T19:44:38.000Z | 2022-02-10T06:48:39.000Z | neural_guided_symbolic_regression/models/mcts.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.58104 | 85 | 0.714948 | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 | 11,078 | 0 | 0 | 0 | 211 | 203 |
c84726272f5ccce872fa9f251d5064eaed566127 | 1,302 | py | Python | Graded/G3/slam/solution/__init__.py | chrstrom/TTK4250 | f453c3a59597d3fe6cff7d35b790689919798b94 | [
"Unlicense"
] | null | null | null | Graded/G3/slam/solution/__init__.py | chrstrom/TTK4250 | f453c3a59597d3fe6cff7d35b790689919798b94 | [
"Unlicense"
] | null | null | null | Graded/G3/slam/solution/__init__.py | chrstrom/TTK4250 | f453c3a59597d3fe6cff7d35b790689919798b94 | [
"Unlicense"
] | null | null | null | from .pytransform import pyarmor_runtime
pyarmor_runtime()
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x09\x00\x61\x0d\x0d\x0a\x08\x2d\xa0\x01\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x18\x3d\x71\xc5\x03\x9e\x68\x9a\xa0\x37\x72\x21\xef\xad\x8a\xf4\x10\x0... | 434 | 1,243 | 0.754992 | from .pytransform import pyarmor_runtime
pyarmor_runtime()
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x09\x00\x61\x0d\x0d\x0a\x08\x2d\xa0\x01\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x18\x3d\x71\xc5\x03\x9e\x68\x9a\xa0\x37\x72\x21\xef\xad\x8a\xf4\x10\x0... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ca24822ceacb59afa74f32fca7fe5d5d075a42c | 5,532 | py | Python | tests/unit/modules/test_mine.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | 1 | 2022-02-09T06:40:14.000Z | 2022-02-09T06:40:14.000Z | tests/unit/modules/test_mine.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_mine.py | xiaowei582648206/saltx | 1d17b030b973ce5422e0fbe7e17c98c7ca91c49b | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Rupesh Tare <rupesht@saltstack.com>
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
# Import Salt Libs
import salt.modules.mine as mine
| 44.256 | 99 | 0.357014 | # -*- coding: utf-8 -*-
'''
:codeauthor: Rupesh Tare <rupesht@saltstack.com>
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (
patch,... | 0 | 5,100 | 0 | 0 | 0 | 0 | 0 | 115 | 89 |
261d9ad0af2c41868951b0b120d7fd4d4af8e62d | 13,215 | py | Python | metrics/custom_losses.py | tbuikr/fastMRI | 4395380bbcddefe0bcfea76a2790e0d978009dea | [
"MIT"
] | 2 | 2019-12-09T04:57:57.000Z | 2020-02-24T18:04:12.000Z | metrics/custom_losses.py | tbuikr/fastMRI | 4395380bbcddefe0bcfea76a2790e0d978009dea | [
"MIT"
] | null | null | null | metrics/custom_losses.py | tbuikr/fastMRI | 4395380bbcddefe0bcfea76a2790e0d978009dea | [
"MIT"
] | null | null | null | #import models.networks as networks
# class CSSIM(nn.Module): # Complementary SSIM
# def __init__(self, default_range=1, filter_size=11, k1=0.01, k2=0.03, sigma=1.5, reduction='mean'):
# super().__init__()
# self.max_val = default_range
# self.filter_size = filter_size
# self.k1 =... | 37.225352 | 139 | 0.62308 | import torch
from torch import nn
import torch.nn.functional as F
from metrics.ssim import ssim
from metrics.tv_loss import TVLoss
#import models.networks as networks
from metrics.my_ssim import ssim_loss
# class CSSIM(nn.Module): # Complementary SSIM
# def __init__(self, default_range=1, filter_size=11, k1=0.01... | 0 | 0 | 0 | 10,588 | 0 | 515 | 0 | 37 | 461 |
36e99d037172fee82cbe9e3275f4053561bba8c8 | 1,808 | py | Python | tests/integration_tests/data_steward/gcloud/gcs_client_test.py | dcarbone/curation | 68f9ba9466646d73509d424567b64566856fb8e8 | [
"MIT"
] | 1 | 2019-03-18T18:22:41.000Z | 2019-03-18T18:22:41.000Z | tests/integration_tests/data_steward/gcloud/gcs_client_test.py | nishanthpp93/curation | ac9f38b2f4580ae806121dd929293159132c7d2a | [
"MIT"
] | null | null | null | tests/integration_tests/data_steward/gcloud/gcs_client_test.py | nishanthpp93/curation | ac9f38b2f4580ae806121dd929293159132c7d2a | [
"MIT"
] | 1 | 2021-09-16T14:25:19.000Z | 2021-09-16T14:25:19.000Z | """
Test the Google Cloud Storage Client and associated helper functions
"""
# Python stl imports
# Project imports
# Third-party imports
| 29.639344 | 79 | 0.606195 | """
Test the Google Cloud Storage Client and associated helper functions
"""
# Python stl imports
import os
import unittest
# Project imports
from gcloud.gcs import StorageClient
# Third-party imports
class GcsClientTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
print('*****************... | 0 | 204 | 0 | 1,377 | 0 | 0 | 0 | -3 | 89 |
e52b2e1c1ea59fa64c3206672451d1ca75882b8f | 297 | py | Python | Contacts/urls.py | simonescob/Agendadj | badd90f3fce0950aa151840f7015c68632c7a203 | [
"MIT"
] | null | null | null | Contacts/urls.py | simonescob/Agendadj | badd90f3fce0950aa151840f7015c68632c7a203 | [
"MIT"
] | null | null | null | Contacts/urls.py | simonescob/Agendadj | badd90f3fce0950aa151840f7015c68632c7a203 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="home"),
path('all', views.index),
path('create', views.create, name="create"),
path('delete/<int:contact_id>', views.delete, name="delete"),
path('edit/<int:contact_id>', views.edit, name="edit"),
] | 29.7 | 62 | 0.680135 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="home"),
path('all', views.index),
path('create', views.create, name="create"),
path('delete/<int:contact_id>', views.delete, name="delete"),
path('edit/<int:contact_id>', views.edit, name="edit"),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c30132e2c9779826c7032440043cdd50a86109e8 | 146 | py | Python | src/dummy.py | ashesh705/master-of-coin | 8ce253cd1c73005856c896a155ef25804d95d02f | [
"MIT"
] | null | null | null | src/dummy.py | ashesh705/master-of-coin | 8ce253cd1c73005856c896a155ef25804d95d02f | [
"MIT"
] | null | null | null | src/dummy.py | ashesh705/master-of-coin | 8ce253cd1c73005856c896a155ef25804d95d02f | [
"MIT"
] | null | null | null | """ Dummy source code to initialize repo"""
from typing import Literal
def dummy() -> Literal[True]:
"""Dummy function"""
return True
| 14.6 | 43 | 0.657534 | """ Dummy source code to initialize repo"""
from typing import Literal
def dummy() -> Literal[True]:
"""Dummy function"""
return True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
202dc2c2ce0978019f7627c8b0b1ddd47cb141d2 | 160 | py | Python | module.py | ShveczovaKS/8lab2k | 1c58ec07c8a7fa5ed9807a7751315131f2e361f0 | [
"MIT"
] | null | null | null | module.py | ShveczovaKS/8lab2k | 1c58ec07c8a7fa5ed9807a7751315131f2e361f0 | [
"MIT"
] | null | null | null | module.py | ShveczovaKS/8lab2k | 1c58ec07c8a7fa5ed9807a7751315131f2e361f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
| 12.307692 | 24 | 0.4875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def get_func(tag):
def func(s):
group = tag, s
return group
return func
| 0 | 0 | 0 | 0 | 0 | 82 | 0 | 0 | 25 |
0ba659f60c6cbb8e70fbe2ade949ed0726b3d12f | 680 | py | Python | crabageprediction/venv/Lib/site-packages/fontTools/misc/cython.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | crabageprediction/venv/Lib/site-packages/fontTools/misc/cython.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 1,599 | 2016-09-27T09:07:36.000Z | 2022-03-31T23:04:51.000Z | crabageprediction/venv/Lib/site-packages/fontTools/misc/cython.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | """ Exports a no-op 'cython' namespace similar to
https://github.com/cython/cython/blob/master/Cython/Shadow.py
This allows to optionally compile @cython decorated functions
(when cython is available at built time), or run the same code
as pure-python, without runtime dependency on cython module.
We only define the s... | 26.153846 | 64 | 0.739706 | """ Exports a no-op 'cython' namespace similar to
https://github.com/cython/cython/blob/master/Cython/Shadow.py
This allows to optionally compile @cython decorated functions
(when cython is available at built time), or run the same code
as pure-python, without runtime dependency on cython module.
We only define the s... | 0 | 0 | 0 | 0 | 0 | 16 | 0 | 12 | 46 |
ab9929ed3ea92aae5e1281a1b168bffd87818815 | 2,172 | py | Python | appengine/swarming/server/acl.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/swarming/server/acl.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/swarming/server/acl.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:37:36.000Z | 2021-12-06T03:37:36.000Z | # Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Defines access groups."""
from components import auth
from components import utils
# Names of groups.
# See https://code.google.com/p/swarming/wiki... | 26.487805 | 78 | 0.743094 | # Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Defines access groups."""
from components import auth
from components import utils
# Names of groups.
# See https://code.google.com/p/swarming/wiki... | 0 | 0 | 0 | 0 | 0 | 321 | 0 | 0 | 138 |
f75d5caf71f40f210458b85e2a678429b8d45bdb | 1,715 | py | Python | suricata-4.1.4/suricata-update/suricata/update/commands/removesource.py | runtest007/dpdk_surcata_4.1.1 | 5abf91f483b418b5d9c2dd410b5c850d6ed95c5f | [
"MIT"
] | 77 | 2019-06-17T07:05:07.000Z | 2022-03-07T03:26:27.000Z | suricata-4.1.4/suricata-update/suricata/update/commands/removesource.py | clockdad/DPDK_SURICATA-4_1_1 | 974cc9eb54b0b1ab90eff12a95617e3e293b77d3 | [
"MIT"
] | 22 | 2019-07-18T02:32:10.000Z | 2022-03-24T03:39:11.000Z | suricata-4.1.4/suricata-update/suricata/update/commands/removesource.py | clockdad/DPDK_SURICATA-4_1_1 | 974cc9eb54b0b1ab90eff12a95617e3e293b77d3 | [
"MIT"
] | 49 | 2019-06-18T03:31:56.000Z | 2022-03-13T05:23:10.000Z | # Copyright (C) 2017 Open Information Security Foundation
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | 34.3 | 73 | 0.749271 | # Copyright (C) 2017 Open Information Security Foundation
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; wi... | 0 | 0 | 0 | 0 | 0 | 811 | 0 | 15 | 114 |
3ca045d0b4c2187471f92b0e5fdbef4d90523a1c | 936 | py | Python | blogs/admin.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null | blogs/admin.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null | blogs/admin.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null |
# Register your models here.
| 22.829268 | 63 | 0.673077 | from django.contrib import admin
from .models import Blog, Category, Tag, Comment
# Register your models here.
@admin.register(Blog)
class AdminBlog(admin.ModelAdmin):
list_display = ['title', 'publishing_date']
list_display_links = ['title', 'publishing_date']
list_filter = ['publishing_date', 'category',... | 0 | 730 | 0 | 0 | 0 | 0 | 0 | 38 | 135 |
7eab3c278fcfc42d13e8ea1b8a894c6d62712411 | 7,206 | py | Python | zcode/inout/tests/test_inout_core.py | lzkelley/zcode | 55a63693fe3ad744957d7ce2d74fb4c8e09ea8ba | [
"MIT"
] | 1 | 2021-02-11T03:24:55.000Z | 2021-02-11T03:24:55.000Z | zcode/inout/tests/test_inout_core.py | lzkelley/zcode | 55a63693fe3ad744957d7ce2d74fb4c8e09ea8ba | [
"MIT"
] | null | null | null | zcode/inout/tests/test_inout_core.py | lzkelley/zcode | 55a63693fe3ad744957d7ce2d74fb4c8e09ea8ba | [
"MIT"
] | null | null | null | """Test methods for `inout_core.py`.
Can be run with:
$ nosetests zcode/inout/tests/test_inout_core.py
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from numpy.testing import run_module_suite
# Run all methods as if with `nosetests ...`
if __name__ == "__main__":
ru... | 37.53125 | 95 | 0.600056 | """Test methods for `inout_core.py`.
Can be run with:
$ nosetests zcode/inout/tests/test_inout_core.py
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import warnings
import shutil
from numpy.testing import run_module_suite
import numpy as np
from nose.tools impor... | 0 | 1,140 | 0 | 5,583 | 0 | 0 | 0 | 12 | 134 |
fb8a1c89bff42274aadcbbd4e1333face551763d | 46 | py | Python | Lecture2/name.py | EusebioSimango/CS50s-Web-Programming-With-Python-And-Javascript | 80df8834c1db8cc28b72d5393ff9aa340c069b57 | [
"MIT"
] | null | null | null | Lecture2/name.py | EusebioSimango/CS50s-Web-Programming-With-Python-And-Javascript | 80df8834c1db8cc28b72d5393ff9aa340c069b57 | [
"MIT"
] | null | null | null | Lecture2/name.py | EusebioSimango/CS50s-Web-Programming-With-Python-And-Javascript | 80df8834c1db8cc28b72d5393ff9aa340c069b57 | [
"MIT"
] | null | null | null | name = input("Mame: ")
print(f"Hello, {name}") | 23 | 23 | 0.608696 | name = input("Mame: ")
print(f"Hello, {name}") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f510ea13d343357dd5eae6dc2035a2c37e918c43 | 2,733 | py | Python | tasksapi/models/validators.py | mwiens91/saltant | 9e72175a896f5859ada304ad3ae4d84dfc3834db | [
"MIT"
] | 3 | 2018-12-08T01:18:29.000Z | 2018-12-14T23:18:42.000Z | tasksapi/models/validators.py | saltant-org/saltant | db498a1186fc74221f8214ad1819dd03bf4b08ac | [
"MIT"
] | 3 | 2019-05-23T07:43:13.000Z | 2021-06-10T20:46:53.000Z | tasksapi/models/validators.py | saltant-org/saltant | db498a1186fc74221f8214ad1819dd03bf4b08ac | [
"MIT"
] | 2 | 2019-03-13T22:31:09.000Z | 2019-05-03T00:18:30.000Z | """Contains validators for task models."""
def task_instance_args_are_valid(instance, fill_missing_args=False):
"""Determines whether a task instance's arguments are valid.
The arguments are valid if the instance's argument includes all of
its task type's required arguments (but not necessarily the
a... | 36.932432 | 78 | 0.668496 | """Contains validators for task models."""
def task_instance_args_are_valid(instance, fill_missing_args=False):
"""Determines whether a task instance's arguments are valid.
The arguments are valid if the instance's argument includes all of
its task type's required arguments (but not necessarily the
a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b18e463d5d6fb71fac9aa5f7d292312fb8ee31b9 | 4,954 | py | Python | semantic_segmentation/keras_metrics.py | Jason-Khan/ubdvss | 76cabfa642af1f659920de32827ea6c3fe008588 | [
"Apache-2.0"
] | 13 | 2020-01-20T13:22:47.000Z | 2021-11-12T07:35:36.000Z | semantic_segmentation/keras_metrics.py | Jason-Khan/ubdvss | 76cabfa642af1f659920de32827ea6c3fe008588 | [
"Apache-2.0"
] | 3 | 2020-09-09T13:19:11.000Z | 2020-11-15T10:52:23.000Z | semantic_segmentation/keras_metrics.py | Jason-Khan/ubdvss | 76cabfa642af1f659920de32827ea6c3fe008588 | [
"Apache-2.0"
] | 5 | 2020-06-01T16:26:07.000Z | 2022-03-08T02:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright () ABBYY (BIT Software), 1993 - 2019. All rights reserved.
"""
keras
"""
import keras.backend as K
import tensorflow as tf
from semantic_segmentation.losses import get_losses
def confusion_matrix(true, pred, weights):
"""
Confusion matrix
... | 25.802083 | 74 | 0.66411 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (С) ABBYY (BIT Software), 1993 - 2019. All rights reserved.
"""
Различные метрики для keras подсчитываемые при обучении
"""
import functools
import keras.backend as K
import tensorflow as tf
from semantic_segmentation.losses import get_losses
def _squeeze_singl... | 738 | 1,326 | 0 | 0 | 0 | 391 | 0 | -5 | 211 |
a675dc6e47d5ff70decc3601d63c4681223ee3d8 | 2,722 | py | Python | datazie/model/LinearModel.py | amozie/amozie | fb7c16ce537bc5567f9c87cfc22c564a4dffc4ef | [
"Apache-2.0"
] | null | null | null | datazie/model/LinearModel.py | amozie/amozie | fb7c16ce537bc5567f9c87cfc22c564a4dffc4ef | [
"Apache-2.0"
] | null | null | null | datazie/model/LinearModel.py | amozie/amozie | fb7c16ce537bc5567f9c87cfc22c564a4dffc4ef | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on %(date)s
@author: %(username)s
"""
import numpy as np
model_sm = 'sm'
if __name__ == '__main__':
x = np.linspace(0, 10, 21)
y = 3*x + 2
y += np.random.randn(x.size)
lm = LinearModel(y, x)
lm.fit()
lm.summary()
print(lm.predict())
lm.plot()
| 26.950495 | 72 | 0.559882 | # -*- coding: utf-8 -*-
"""
Created on %(date)s
@author: %(username)s
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import linear_model
import statsmodels.api as sm
from statsmodels.sandbox.regression.predstd import wls_prediction_std
model_sm = 'sm'
... | 60 | 0 | 0 | 2,130 | 0 | 0 | 0 | 74 | 179 |
b67a3f691f33184cbbf6898ebf7144756349476d | 4,888 | py | Python | utilities.py | rc1035/directed-probe-matching | c724096672e778202d9e8ed197cdf7395ea1d211 | [
"MIT"
] | 10 | 2017-08-16T12:16:52.000Z | 2022-02-26T05:09:39.000Z | utilities.py | d15c0/directed-probe-matching | c724096672e778202d9e8ed197cdf7395ea1d211 | [
"MIT"
] | 1 | 2019-07-10T12:00:00.000Z | 2019-07-10T12:00:00.000Z | utilities.py | d15c0/directed-probe-matching | c724096672e778202d9e8ed197cdf7395ea1d211 | [
"MIT"
] | 4 | 2017-11-30T11:01:06.000Z | 2019-11-03T23:39:40.000Z | #!/usr/bin/env python3.6
"""Refactored utility functions."""
__author__ = "Richard Cosgrove"
from collections import defaultdict
import gzip
from itertools import combinations
from datetime import timedelta
import json
import os
def export_compressed_json(dict_item, file_name):
"""Export gzip compressed JSON.
... | 36.75188 | 112 | 0.672054 | #!/usr/bin/env python3.6
"""Refactored utility functions."""
__author__ = "Richard Cosgrove"
from collections import defaultdict
import gzip
from itertools import combinations
from datetime import datetime, timedelta
import json
import os
def export_compressed_json(dict_item, file_name):
"""Export gzip compress... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0 |
0e899a0c6dc84c26eed43123ac191ce6e094f3ae | 3,464 | py | Python | nautobot/users/tests/test_models.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 384 | 2021-02-24T01:40:40.000Z | 2022-03-30T10:30:59.000Z | nautobot/users/tests/test_models.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 1,067 | 2021-02-24T00:58:08.000Z | 2022-03-31T23:38:23.000Z | nautobot/users/tests/test_models.py | psmware-ltd/nautobot | ac516287fb8edcc3482bd011839de837c6bbf0df | [
"Apache-2.0"
] | 128 | 2021-02-24T02:45:16.000Z | 2022-03-20T18:48:36.000Z | from django.contrib.auth import get_user_model
# Use the proper swappable User model
User = get_user_model()
| 33.631068 | 87 | 0.566397 | from django.contrib.auth import get_user_model
from django.test import TestCase
# Use the proper swappable User model
User = get_user_model()
class UserConfigTest(TestCase):
def setUp(self):
user = User.objects.create_user(username="testuser")
user.config_data = {
"a": True,
... | 0 | 0 | 0 | 3,296 | 0 | 0 | 0 | 11 | 45 |
58ff00ab9dd53405c8606240357d386f8a7c8414 | 3,823 | py | Python | lib/googlecloudsdk/api_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/sql/instances.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.754545 | 79 | 0.757782 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 2,374 | 0 | 391 | 0 | 0 | 0 | 94 | 158 |
a6e3fb81075849bc5006590462c1692cddcd0b28 | 1,912 | py | Python | catalog/general/catalog_logger.py | eoss-cloud/madxxx_catalog_api | ef37374a36129de4f0a6fe5dd46b5bc2e2f01d1d | [
"MIT"
] | null | null | null | catalog/general/catalog_logger.py | eoss-cloud/madxxx_catalog_api | ef37374a36129de4f0a6fe5dd46b5bc2e2f01d1d | [
"MIT"
] | null | null | null | catalog/general/catalog_logger.py | eoss-cloud/madxxx_catalog_api | ef37374a36129de4f0a6fe5dd46b5bc2e2f01d1d | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
""" EOSS catalog system
Custom logger
Default configuration file within this directory is used to control logging behaviour; can be overwritten with LOGGING_CONF which points to
local logging configuration
"""
__author__ = "Thilo Wehrmann, Steffen Gebhardt"
__copyright__ = "Copyright 2016, E... | 26.191781 | 140 | 0.764644 | #-*- coding: utf-8 -*-
""" EOSS catalog system
Custom logger
Default configuration file within this directory is used to control logging behaviour; can be overwritten with LOGGING_CONF which points to
local logging configuration
"""
__author__ = "Thilo Wehrmann, Steffen Gebhardt"
__copyright__ = "Copyright 2016, E... | 0 | 0 | 0 | 63 | 0 | 0 | 0 | 0 | 26 |
25781249bb36750915e0251ce1e74e198d0fa28a | 8,973 | py | Python | deeplearning/ml4pl/models/batch.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | null | null | null | deeplearning/ml4pl/models/batch.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 2 | 2020-07-27T08:22:06.000Z | 2020-07-30T17:34:35.000Z | deeplearning/ml4pl/models/batch.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 1 | 2020-06-05T04:58:13.000Z | 2020-06-05T04:58:13.000Z | # Copyright 2019 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.com>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 30.110738 | 78 | 0.701995 | # Copyright 2019 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.com>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 3,688 | 0 | 3,755 | 0 | 0 | 0 | 21 | 247 |
bd43660e61d12126149a6be149f44586a149537b | 102 | py | Python | python/python-tutorial/10_packages/package_a/subpackage_a/a_module.py | wesleyegberto/dojos-languages | 87170a722efac1247c713daa21cb3fcc39f5c5c1 | [
"MIT"
] | null | null | null | python/python-tutorial/10_packages/package_a/subpackage_a/a_module.py | wesleyegberto/dojos-languages | 87170a722efac1247c713daa21cb3fcc39f5c5c1 | [
"MIT"
] | null | null | null | python/python-tutorial/10_packages/package_a/subpackage_a/a_module.py | wesleyegberto/dojos-languages | 87170a722efac1247c713daa21cb3fcc39f5c5c1 | [
"MIT"
] | null | null | null | # A module inside the package
print("Module: ", __name__)
| 12.75 | 29 | 0.666667 | # A module inside the package
print("Module: ", __name__)
def do_stuff():
print("Doing stuff")
| 0 | 0 | 0 | 0 | 0 | 19 | 0 | 0 | 23 |
ea15f02ea347cde7a8bc22e6cd2d89594e3df3dd | 1,096 | py | Python | easy/1025-Divisor Game.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | 2 | 2020-05-08T02:17:17.000Z | 2020-05-17T04:55:56.000Z | easy/1025-Divisor Game.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | easy/1025-Divisor Game.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | """
https://leetcode.com/problems/divisor-game/
Alice and Bob take turns playing a game, with Alice starting first.
Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of:
Choosing any x with 0 < x < N and N % x == 0.
Replacing the number N on the chalkboard w... | 25.488372 | 113 | 0.636861 | """
https://leetcode.com/problems/divisor-game/
Alice and Bob take turns playing a game, with Alice starting first.
Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of:
Choosing any x with 0 < x < N and N % x == 0.
Replacing the number N on the chalkboard w... | 0 | 0 | 0 | 314 | 0 | 0 | 0 | 0 | 23 |
56a51529edb0ee5b8e263f380f1c7725ffa73944 | 4,540 | py | Python | evalml/automl/engine/sequential_engine.py | BlockchainClimateInstitute/price_microservice | 11d1cff8965fe1befc997e9da3dc09efceed4579 | [
"BSD-3-Clause"
] | null | null | null | evalml/automl/engine/sequential_engine.py | BlockchainClimateInstitute/price_microservice | 11d1cff8965fe1befc997e9da3dc09efceed4579 | [
"BSD-3-Clause"
] | null | null | null | evalml/automl/engine/sequential_engine.py | BlockchainClimateInstitute/price_microservice | 11d1cff8965fe1befc997e9da3dc09efceed4579 | [
"BSD-3-Clause"
] | null | null | null | from evalml.utils import get_logger
logger = get_logger(__file__)
| 42.830189 | 109 | 0.620485 | import sys
import traceback
import numpy as np
from evalml.automl.engine import EngineBase
from evalml.exceptions import PipelineScoreError
from evalml.model_family import ModelFamily
from evalml.objectives.utils import get_objective
from evalml.utils import get_logger
logger = get_logger(__file__)
class Sequentia... | 0 | 0 | 0 | 4,213 | 0 | 0 | 0 | 80 | 179 |
ee2569e70a693fb7569365e25bd376b146aaf167 | 877 | py | Python | source/read-file/app.py | aws-samples/aws-serverless-batch-architecture | 1672d7623c2a0b6141bf83d019efe3c6c70efd00 | [
"MIT-0"
] | 14 | 2021-11-12T02:02:46.000Z | 2022-03-01T23:28:48.000Z | source/read-file/app.py | aws-samples/aws-serverless-batch-architecture | 1672d7623c2a0b6141bf83d019efe3c6c70efd00 | [
"MIT-0"
] | 1 | 2021-11-01T02:56:34.000Z | 2022-01-17T00:19:53.000Z | source/read-file/app.py | aws-samples/aws-serverless-batch-architecture | 1672d7623c2a0b6141bf83d019efe3c6c70efd00 | [
"MIT-0"
] | 1 | 2022-03-24T13:00:45.000Z | 2022-03-24T13:00:45.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import s3fs
s3 = s3fs.S3FileSystem(anon=False)
header = [
'uuid',
'country',
'itemType',
'salesChannel',
'orderPriority',
'orderDate',
'region',
'shipDate'
]
| 21.390244 | 78 | 0.58951 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import csv
import s3fs
import os
s3 = s3fs.S3FileSystem(anon=False)
header = [
'uuid',
'country',
'itemType',
'salesChannel',
'orderPriority',
'orderDate',
'region',
'shipDate'
]
def... | 0 | 0 | 0 | 0 | 0 | 535 | 0 | -23 | 67 |
85f1aa282d6853f2f160254093d5add98f8f0f8b | 5,210 | py | Python | modules/differentialLine.py | inconvergent/differential-line-cuda | 07927dff7c3178821776fccd5ad0aa196a3bb858 | [
"MIT"
] | 21 | 2016-05-22T17:40:02.000Z | 2022-02-03T11:36:31.000Z | modules/differentialLine.py | inconvergent/differential-line-cuda | 07927dff7c3178821776fccd5ad0aa196a3bb858 | [
"MIT"
] | null | null | null | modules/differentialLine.py | inconvergent/differential-line-cuda | 07927dff7c3178821776fccd5ad0aa196a3bb858 | [
"MIT"
] | 2 | 2017-03-17T05:13:16.000Z | 2021-12-09T02:20:03.000Z | # -*- coding: utf-8 -*-
from numpy import pi
TWOPI = pi*2
PI = pi
| 18.876812 | 65 | 0.55739 | # -*- coding: utf-8 -*-
from numpy import pi
from numpy import zeros
from numpy import sin
from numpy import cos
from numpy import sqrt
from numpy.random import random
from numpy import float32 as npfloat
from numpy import int32 as npint
TWOPI = pi*2
PI = pi
class DifferentialLine(object):
def __init__(
... | 0 | 0 | 0 | 4,917 | 0 | 0 | 0 | 39 | 178 |
9c9a724dc974172fe6713d50c40457af8df6ee64 | 2,802 | py | Python | main.py | greenactionstudio/openleadr-python | 03f2ceb3d9a8a2ffdffb67c99ec116187b9ee063 | [
"Apache-2.0"
] | null | null | null | main.py | greenactionstudio/openleadr-python | 03f2ceb3d9a8a2ffdffb67c99ec116187b9ee063 | [
"Apache-2.0"
] | null | null | null | main.py | greenactionstudio/openleadr-python | 03f2ceb3d9a8a2ffdffb67c99ec116187b9ee063 | [
"Apache-2.0"
] | 1 | 2021-11-03T02:36:32.000Z | 2021-11-03T02:36:32.000Z | from flask import Flask
import os
import threading
import nest_asyncio
from openleadr.client import OpenADRClient
from openleadr.utils import report_callback
from openleadr.enums import MEASUREMENTS
nest_asyncio.apply()
client = OpenADRClient(ven_name='myven', vtn_url=os.environ.get('VTN_URL'))
client.add_report(repor... | 38.916667 | 120 | 0.745182 | from logging import debug, exception
from flask import Flask, request
import os
import asyncio
import threading
import ssl
import aiohttp
import nest_asyncio
import json
from openleadr.client import OpenADRClient
from openleadr.utils import report_callback
from openleadr.enums import MEASUREMENTS
nest_asyncio.apply()
... | 0 | 1,663 | 0 | 0 | 0 | 90 | 0 | -11 | 317 |
0a7253e54a7ce0b7e58517111d748be3f97a40cb | 2,816 | py | Python | sound_lib/external/pybass_aac.py | ctoth/sound_lib | 0e0544a1f4e5da5bc2e0ee99cd7c5bac9ba934c6 | [
"MIT"
] | 1 | 2020-09-03T15:35:03.000Z | 2020-09-03T15:35:03.000Z | sound_lib/external/pybass_aac.py | ctoth/sound_lib | 0e0544a1f4e5da5bc2e0ee99cd7c5bac9ba934c6 | [
"MIT"
] | 2 | 2020-09-25T05:47:44.000Z | 2021-06-25T15:25:34.000Z | sound_lib/external/pybass_aac.py | ctoth/sound_lib | 0e0544a1f4e5da5bc2e0ee99cd7c5bac9ba934c6 | [
"MIT"
] | 2 | 2020-01-05T16:24:20.000Z | 2020-09-03T15:35:07.000Z | from __future__ import absolute_import
# Copyright(c) Max Kolosov 2009 maxkolosov@inbox.ru
# http://vosolok2008.narod.ru
# BSD license
__version__ = '0.1'
__versionTime__ = '2009-11-15'
__author__ = 'Max Kolosov <maxkolosov@inbox.ru>'
__doc__ = '''
pybass_aac.py - is ctypes python module for
BASS_AAC - exten... | 52.148148 | 184 | 0.79652 | from __future__ import absolute_import
# Copyright(c) Max Kolosov 2009 maxkolosov@inbox.ru
# http://vosolok2008.narod.ru
# BSD license
__version__ = '0.1'
__versionTime__ = '2009-11-15'
__author__ = 'Max Kolosov <maxkolosov@inbox.ru>'
__doc__ = '''
pybass_aac.py - is ctypes python module for
BASS_AAC - exten... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
0a79e9ed00dd7cff3b0787278aa3e51a4698409f | 31,754 | py | Python | src/olympia/addons/views.py | tapaswenipathak/addons-server | b7085559a754248a8baade399d5a27f2c3e3ca7e | [
"BSD-3-Clause"
] | 1 | 2019-08-17T21:17:50.000Z | 2019-08-17T21:17:50.000Z | src/olympia/addons/views.py | tapaswenipathak/addons-server | b7085559a754248a8baade399d5a27f2c3e3ca7e | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/views.py | tapaswenipathak/addons-server | b7085559a754248a8baade399d5a27f2c3e3ca7e | [
"BSD-3-Clause"
] | null | null | null |
import olympia.core.logger
from .decorators import addon_view_factory
from .models import Addon
log = olympia.core.logger.getLogger('z.addons')
addon_view = addon_view_factory(qs=Addon.objects.valid)
addon_valid_disabled_pending_view = addon_view_factory(
qs=Addon.objects.valid_and_disabled_and_pending)
DEFA... | 41.891821 | 79 | 0.653776 | from collections import OrderedDict
from django import http
from django.db.models import Prefetch
from django.db.transaction import non_atomic_requests
from django.shortcuts import redirect
from django.utils.cache import patch_cache_control
from django.utils.decorators import method_decorator
from django.views.decorat... | 0 | 1,135 | 0 | 27,150 | 0 | 590 | 0 | 1,496 | 940 |
3840052143a4c80cb731fce500d7e4cb9f141b98 | 11,603 | py | Python | scheduling/methods/k_means_NN_naive.py | CORE-Robotics-Lab/Personalized_Neural_Trees | 3e8dd12fe4fc850be65c96c847eb143ef3bcdc2e | [
"MIT"
] | 3 | 2021-05-22T19:25:01.000Z | 2021-12-01T07:59:56.000Z | scheduling/methods/k_means_NN_naive.py | CORE-Robotics-Lab/Personalized_Neural_Trees | 3e8dd12fe4fc850be65c96c847eb143ef3bcdc2e | [
"MIT"
] | null | null | null | scheduling/methods/k_means_NN_naive.py | CORE-Robotics-Lab/Personalized_Neural_Trees | 3e8dd12fe4fc850be65c96c847eb143ef3bcdc2e | [
"MIT"
] | null | null | null | """
Created by Rohan Paleja on September 23, 2019
Nikolaidis et. al. benchmark
"""
import torch
# sys.path.insert(0, '/home/Anonymous/PycharmProjects/bayesian_prolo')
import numpy as np
# sys.path.insert(0, '../')
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
torch.manual_seed(0)
... | 40.010345 | 171 | 0.620271 | """
Created by Rohan Paleja on September 23, 2019
Nikolaidis et. al. benchmark
"""
import torch
import torch.nn.functional as F
# sys.path.insert(0, '/home/Anonymous/PycharmProjects/bayesian_prolo')
import numpy as np
import pickle
from torch.autograd import Variable
from utils.naive_utils import load_in_naive_data,... | 0 | 1,117 | 0 | 9,366 | 0 | 0 | 0 | 202 | 220 |
b388f68a9de50b2d68147365e456767b8e775cd2 | 1,167 | py | Python | candy_collect.py | itiB/poke-scripts | e2da1356ee8000c7345682d4c07709481f2044f8 | [
"MIT"
] | 2 | 2020-02-08T13:55:46.000Z | 2020-07-21T13:17:26.000Z | candy_collect.py | itiB/poke-scripts | e2da1356ee8000c7345682d4c07709481f2044f8 | [
"MIT"
] | null | null | null | candy_collect.py | itiB/poke-scripts | e2da1356ee8000c7345682d4c07709481f2044f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import serial
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument('port')
args = parser.parse_args()
sleep_time = 50
ser = serial.Serial(args.port, 9600)
sleep(3)
send('Button LCLICK', 0.1)
try:
while 1:
candyCorrect... | 19.131148 | 51 | 0.552699 | #!/usr/bin/env python3
import argparse
import serial
import time
from time import sleep
import datetime
parser = argparse.ArgumentParser()
parser.add_argument('port')
args = parser.parse_args()
sleep_time = 50
def send(msg, duration=0):
print(msg)
ser.write(f'{msg}\r\n'.encode('utf-8'))
s... | 30 | 0 | 0 | 0 | 0 | 686 | 0 | -16 | 96 |
a4ef9bd877c250ea0e460a024503d8e819218c76 | 3,683 | py | Python | utils_ic.py | kkkgabriel/50039Homework3 | 69d8f36f60868cac64bb1d1682eba34a548f3565 | [
"MIT"
] | null | null | null | utils_ic.py | kkkgabriel/50039Homework3 | 69d8f36f60868cac64bb1d1682eba34a548f3565 | [
"MIT"
] | null | null | null | utils_ic.py | kkkgabriel/50039Homework3 | 69d8f36f60868cac64bb1d1682eba34a548f3565 | [
"MIT"
] | null | null | null | import torch
from torchvision import transforms
from PIL import Image
# Define function to read cat names
# Define function to read data
# Define processing testing image function
def process_image(image):
''' Scales, crops, and normalizes a PIL image for a PyTorch model,
returns an Numpy array
'''
... | 41.852273 | 88 | 0.581048 | import json
import torch
from torchvision import datasets, transforms
from PIL import Image
# Define function to read cat names
def read_jason(filename):
with open(filename, 'r') as f:
cat_to_name = json.load(f)
return cat_to_name
# Define function to read data
def load_data(data_dir):
train_dir =... | 0 | 0 | 0 | 0 | 0 | 1,850 | 0 | 0 | 66 |
7c9ecc3b2e26c62f94ef6497972cb0e25e5a58f9 | 13,851 | py | Python | tensorflow/python/tools/freeze_graph_test.py | yage99/tensorflow | c7fa71b32a3635eb25596ae80d007b41007769c4 | [
"Apache-2.0"
] | 78 | 2020-08-04T12:36:25.000Z | 2022-03-25T04:23:40.000Z | tensorflow/python/tools/freeze_graph_test.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/tools/freeze_graph_test.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 28 | 2020-02-10T07:03:06.000Z | 2022-01-12T11:19:20.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.264535 | 80 | 0.695401 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 2,551 | 0 | 9,185 | 0 | 0 | 0 | 615 | 576 |