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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6c38fa0bd9e315dd1842c9792fab88a708b5c6cb | 15,911 | py | Python | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | null | null | null | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-07-03T13:32:38.000Z | 2019-07-03T13:32:38.000Z | extensions/mark_invoices.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-05-15T16:01:31.000Z | 2019-05-15T16:01:31.000Z | #! /usr/bin/python
# Copyright (C) 2005 Dr. Ralf Schlatterbeck Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: office@runtux.com
# All rights reserved
# ****************************************************************************
#
# This program is free software; you c... | 35.515625 | 80 | 0.539941 | #! /usr/bin/python
# Copyright (C) 2005 Dr. Ralf Schlatterbeck Open Source Consulting.
# Reichergasse 131, A-3411 Weidling.
# Web: http://www.runtux.com Email: office@runtux.com
# All rights reserved
# ****************************************************************************
#
# This program is free software; you c... | 0 | 0 | 0 | 13,027 | 0 | 484 | 0 | 369 | 510 |
91e13dc5dce4394facd41c473ef017637c7b7efb | 3,614 | py | Python | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | 1 | 2018-06-28T09:49:08.000Z | 2018-06-28T09:49:08.000Z | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | null | null | null | lib/market/market_quote.py | myron0330/metatrade | b0358ad3dce6ba50e4801b6af557d7883d8a5d9a | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
# **********************************************************************************#
# File:
# **********************************************************************************#
from .. configs import logger
from .. data.database_api import load_futures_rt_minute_data
def _get_minute_pri... | 34.75 | 101 | 0.522413 | # -*- coding: UTF-8 -*-
# **********************************************************************************#
# File:
# **********************************************************************************#
import time
from datetime import datetime
from utils.dict import CompositeDict
from utils.decorator import singl... | 0 | 2,675 | 0 | 0 | 0 | 0 | 0 | 29 | 111 |
e68c200f43159bf514afe9d579f8930fcb12c17b | 1,179 | py | Python | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | src/shapefiles/migrations/0001_initial.py | ro-hit81/reposit | 2d16ce6aaa565f5f659d8e370c888844a01f6030 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.1 on 2019-08-03 05:44
| 35.727273 | 114 | 0.579304 | # Generated by Django 2.2.1 on 2019-08-03 05:44
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Parcel',
fields=... | 0 | 0 | 0 | 1,022 | 0 | 0 | 0 | 40 | 68 |
2aa5c07dd8585aedf7b1d130332630d71b1b552a | 3,068 | py | Python | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | 1 | 2021-09-26T06:54:44.000Z | 2021-09-26T06:54:44.000Z | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | null | null | null | sport.py | hexuustc/weixin_sport | 6b4ab18dc48c9fb97301d2f193746effc4988f74 | [
"MIT"
] | null | null | null | # encoding=utf8
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='weixin auto sport script.')
parser.add_argument('user', help='your user name', type=str)
parser.add_argument('password', help='your password', type=str)
args = parser.parse_args()
autorepoter = ... | 35.674419 | 159 | 0.550847 | # encoding=utf8
import requests
import datetime
import pytz
import argparse
import random
import json
class Report(object):
def __init__(self, user, password):
self.user = user
self.password = password
def report(self):
url = "https://xzdx.xyz/x/ym/yzmb/api.php"
timenow = datet... | 0 | 0 | 0 | 2,367 | 0 | 0 | 0 | -40 | 133 |
f8eb53b19f7d0ed80f555946ddeb4af5858c61b4 | 2,698 | py | Python | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | 1 | 2020-06-11T21:19:25.000Z | 2020-06-11T21:19:25.000Z | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | null | null | null | web/wrpbg/pb_server.py | mccreery/sandbox | 43e81c7f908feedd8e1b6e28ee07870d02012f4c | [
"Unlicense"
] | 1 | 2020-06-11T21:19:26.000Z | 2020-06-11T21:19:26.000Z | import http.server
username_cache = {}
whitelist = ("current.html", "runner64.png", "flags.min.css", "flags.png")
mimes = {
"html": "text/html",
"css": "text/css",
"png": "image/png",
"json": "application/jsonn"
}
PAGE_404 = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 Not Found</title>... | 27.252525 | 113 | 0.642328 | import http.server, requests, json
username_cache = {}
whitelist = ("current.html", "runner64.png", "flags.min.css", "flags.png")
mimes = {
"html": "text/html",
"css": "text/css",
"png": "image/png",
"json": "application/jsonn"
}
PAGE_404 = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 N... | 0 | 157 | 0 | 1,611 | 0 | 0 | 0 | 16 | 23 |
8c562da3b379f70ca048f530b14ad2a31026c4c4 | 14,618 | py | Python | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | gpcsup/__init__.py | braedon/gpcsup | a20c9fbc7d5c0191a87553b8588757b1528fe655 | [
"MIT"
] | null | null | null | import logging
import re
from datetime import timedelta
from publicsuffixlist import PublicSuffixList
log = logging.getLogger(__name__)
# Disable some logging to reduce log spam.
# Elasticsearch logs all requests at (at least) INFO level.
logging.getLogger('elasticsearch').setLevel(logging.WARNING)
PSL_CACHE_SIZE =... | 36.636591 | 119 | 0.606718 | import functools
import idna
import logging
import re
import requests
import rfc3339
import time
from bottle import Bottle, request, response, static_file, template, redirect
from datetime import timedelta
from publicsuffixlist import PublicSuffixList
from requests_oauthlib import OAuth1
from urllib.parse import urlsp... | 0 | 7,982 | 0 | 197 | 0 | 4,000 | 0 | 213 | 407 |
6b4c0e4b75266ca932765f704bc1f94c6b42332b | 8,005 | py | Python | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | frappe/database/query.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | import operator
from typing import Any, List, Tuple, Union
import frappe
from frappe.query_builder import Field, Order
def like(key: str, value: str) -> frappe.qb:
"""Wrapper method for `LIKE`
Args:
key (str): field
value (str): criterion
Returns:
frappe.qb: `frappe.qb object with `LIKE`
"""
return Fiel... | 24.331307 | 101 | 0.672705 | import operator
import re
from typing import Any, Dict, List, Tuple, Union
import frappe
from frappe import _
from frappe.query_builder import Criterion, Field, Order
def like(key: str, value: str) -> frappe.qb:
"""Wrapper method for `LIKE`
Args:
key (str): field
value (str): criterion
Returns:
frappe.qb:... | 0 | 728 | 0 | 4,648 | 0 | 0 | 0 | 4 | 137 |
862cafed433a27c4c636e2ae6a6289b7ce389dab | 2,788 | py | Python | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 64 | 2020-04-27T14:55:15.000Z | 2020-10-25T06:57:56.000Z | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 85 | 2020-04-26T06:29:47.000Z | 2020-10-19T20:28:52.000Z | test/cut/test_cut_set_creation.py | pzelasko/lhotse | 41984467d2ead1dc69f418638b969e46f63308c7 | [
"Apache-2.0"
] | 17 | 2020-06-19T06:26:33.000Z | 2020-10-12T15:19:15.000Z | from lhotse.features import Features
def features(rec_id, start, duration):
"""Helper method for fixture readability (specify only relevant attributes)."""
return Features(
recording_id=rec_id,
channels=0,
start=start,
duration=duration,
sampling_rate=16000,
typ... | 34 | 83 | 0.641679 | import pytest
from lhotse.cut import make_windowed_cuts_from_features
from lhotse.features import Features, FeatureSet
def features(rec_id, start, duration):
"""Helper method for fixture readability (specify only relevant attributes)."""
return Features(
recording_id=rec_id,
channels=0,
... | 0 | 122 | 0 | 1,960 | 0 | 0 | 0 | 38 | 90 |
1cdf6f8a3f98fd2219e9f83b7c43e32f18d29505 | 3,608 | py | Python | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 40 | 2022-03-02T01:29:29.000Z | 2022-03-31T16:02:01.000Z | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 62 | 2022-03-11T00:12:37.000Z | 2022-03-31T20:04:27.000Z | torchdynamo/allowed_functions.py | frank-wei/torchdynamo | 26c4c1b593bebf4246e566749dade38254b59ffb | [
"BSD-3-Clause"
] | 4 | 2022-03-09T18:43:20.000Z | 2022-03-31T01:01:26.000Z |
def is_allowed(obj):
"""Is this safe to trace like torch.add ?"""
return id(obj) in _allowed_function_ids()
def is_disallowed(obj):
"""Is this safe to trace like torch.add ?"""
return id(obj) in _disallowed_function_ids()
| 26.925373 | 87 | 0.625277 | import builtins
import collections
import copy
import functools
import itertools
import math
import operator
import types
import warnings
from functools import lru_cache
import numpy
import torch
from . import config
@lru_cache(None)
def _disallowed_function_ids():
remove = [
True,
False,
... | 0 | 2,883 | 0 | 0 | 0 | 120 | 0 | -69 | 426 |
d10f5a7b45ca2a640954b3379de28abe47aa8a4b | 9,790 | py | Python | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | 3 | 2021-08-10T02:31:24.000Z | 2021-12-28T09:34:01.000Z | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | null | null | null | utils/cloze_mc_model.py | kenchan0226/control-sum-cmdp | 5181e8e0c9bf6bef48f66457e06d3f398f4a428a | [
"MIT"
] | 1 | 2021-12-02T15:53:22.000Z | 2021-12-02T15:53:22.000Z | import torch
import os
import json
MAX_CONTEXT_LEN = 120
if __name__ == "__main__":
cloze_model = ClozeMCModel("cuda:0")
split_dir="/mnt/sharedfolder/hpchan/datasets/cased-cnn-dailymail_coref/train"
with open(os.path.join(split_dir, "{}.json".format(0))) as f:
js = json.loads(f.read())
"""
... | 56.264368 | 187 | 0.71665 | from transformers import BertConfig, BertForSequenceClassification, BertTokenizer
import torch
import os
import json
import logging
MAX_CONTEXT_LEN = 120
class ClozeMCModel:
def __init__(self, device):
self.device = device
self.model_path = "saved_models/entity_cloze_mc_coref_cnn_remove_duplicat... | 0 | 0 | 0 | 5,747 | 0 | 0 | 0 | 53 | 67 |
145f855179547244441085eb5696c4ff8167f388 | 4,685 | py | Python | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | 1 | 2019-07-16T03:54:22.000Z | 2019-07-16T03:54:22.000Z | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | null | null | null | tests/hypothesis2_4_masks.py | davtoh/RRTools | 6dde2d4622719d9031bf21ffbf7723231a0e2003 | [
"BSD-3-Clause"
] | 1 | 2019-07-09T02:49:06.000Z | 2019-07-09T02:49:06.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from .tesisfunctions import Plotim, overlay
import cv2
import numpy as np
#from invariantMoments import centroid,invmoments,normalizedinvariantmoment,bw... | 32.534722 | 137 | 0.704803 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from .tesisfunctions import Plotim,overlay,padVH
import cv2
import numpy as np
#from invariantMoments import centroid,invmoments,normalizedinvariantmome... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0 |
8eb87ebacb5175749b25e51af42bb1da2f1af53b | 4,924 | py | Python | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | 3 | 2021-02-16T11:40:23.000Z | 2021-02-27T20:03:42.000Z | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | 1 | 2021-02-27T20:43:06.000Z | 2021-02-27T20:43:06.000Z | PyNewsletter.py | Diogo-Paulico/PyNewsletter | a8e4782e96a21fb436d020643083edb3008d0268 | [
"MIT"
] | null | null | null | import email
# Loads the csv file given by the CSV_FILE variable
# @return -> list of email addresses contained in the column Email
# Loads the email body from the TEXT_BODY_FILE
body = open(TEXT_BODY_FILE,'r').read()
# Removes the given email from the loaded CSV file containing the emails
# @return -> True is the e... | 35.941606 | 152 | 0.667141 | import email, smtplib, ssl, sys, imaplib, email.header
import pandas as pd
from config import *
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Loads the csv file given by the CSV_FILE variable
# @return -> list of e... | 0 | 0 | 0 | 0 | 0 | 3,073 | 0 | 99 | 287 |
4aa1225b275666806c08c3f04e1756fc027da524 | 808 | py | Python | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | null | null | null | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | 1 | 2021-12-10T07:24:13.000Z | 2021-12-11T05:10:50.000Z | aoc15-2.py | UnrelatedString/advent-of-code-2021 | f802240ce01dc9e31f152915456aff2644b281e2 | [
"MIT"
] | null | null | null | import heapq as hq
ls = lines()#chunks()#nums()
cs = {}
d = {}
for y,l in enumerate(ls):
for x,n in enumerate(l):
n = eval(n)
for Y in range(5):
for X in range(5):
c=complex(x+len(l)*X,y+len(ls)*Y)
cs[c] = (n-1+X+Y)%9+1
d[c] = float('inf'... | 21.837838 | 55 | 0.483911 | import sys
from stuff import *
import heapq as hq
ls = lines()#chunks()#nums()
cs = {}
d = {}
for y,l in enumerate(ls):
for x,n in enumerate(l):
n = eval(n)
for Y in range(5):
for X in range(5):
c=complex(x+len(l)*X,y+len(ls)*Y)
cs[c] = (n-1+X+Y)%9+1
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -13 | 44 |
ca605f86181c04b6e4c6071ff1fa0fae67e38c02 | 1,994 | py | Python | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 14 | 2019-02-27T13:57:36.000Z | 2021-10-01T14:29:38.000Z | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 11 | 2019-06-13T06:38:43.000Z | 2021-06-15T13:51:39.000Z | core/urls.py | jianxinwang/GenEsysV | 444b4685b603c3da5ac9d9265817cac98c33c97e | [
"BSD-3-Clause"
] | 5 | 2019-02-27T13:57:40.000Z | 2020-02-09T13:15:06.000Z | from django.urls import path
import core.views as core_views
urlpatterns = (
path('dataset-snippet/<int:study_id>',
core_views.DatasetSnippetView.as_view(), name='dataset-snippet'),
path('analysis-type-snippet/<int:dataset_id>',
core_views.AnalysisTypeSnippetView.as_view(), name='analysis-ty... | 73.851852 | 166 | 0.746239 | from django.urls import path
import core.views as core_views
urlpatterns = (
path('dataset-snippet/<int:study_id>',
core_views.DatasetSnippetView.as_view(), name='dataset-snippet'),
path('analysis-type-snippet/<int:dataset_id>',
core_views.AnalysisTypeSnippetView.as_view(), name='analysis-ty... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa98caab9a7b0286b7b7c07c740bcf0da51f0601 | 203 | py | Python | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | days/04-06-collections/D5/sorting.py | angersa/100daysofcode-with-python-course | 4b7a28604214a49faf243c543f67bc8dc3eab349 | [
"MIT"
] | null | null | null | disordered = {(10, 5): 'b', (3, 10): 'a', (5, 2): 'c'}
# sort keys, then get values from original - fast
sorted_list = sorted(disordered.items(), key=lambda x: x[0][1], reverse=True)
print(sorted_list) | 33.833333 | 77 | 0.640394 | disordered = {(10, 5): 'b', (3, 10): 'a', (5, 2): 'c'}
# sort keys, then get values from original - fast
sorted_list = sorted(disordered.items(), key=lambda x: x[0][1], reverse=True)
print(sorted_list) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d40d1402ab5ddaccc60f54e6b0bffbc87134f18a | 16,587 | py | Python | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 5 | 2020-07-01T13:18:53.000Z | 2022-03-04T20:54:14.000Z | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 44 | 2019-10-19T00:13:55.000Z | 2022-01-01T04:42:02.000Z | vcstools/beam_calc.py | cplee1/vcstools_chris_duplicate | e929e01d886e6ce8c113af3b02c2590b441daa03 | [
"AFL-3.0"
] | 6 | 2019-10-29T10:51:51.000Z | 2022-03-04T20:54:28.000Z | import os
import sys
import numpy as np
import math
#MWA scripts
from mwa_pb import primary_beam
from vcstools.pointing_utils import sex2deg
from vcstools.metadb_utils import mwa_alt_az_za, get_common_obs_metadata, getmeta
import logging
logger = logging.getLogger(__name__)
def pixel_area(ra_min, ra_max, dec_min, ... | 40.555012 | 115 | 0.5816 | import os
import sys
import numpy as np
import math
#MWA scripts
from mwa_pb import primary_beam
from vcstools.pointing_utils import sex2deg
from vcstools.metadb_utils import mwa_alt_az_za, get_common_obs_metadata, getmeta
import logging
logger = logging.getLogger(__name__)
def pixel_area(ra_min, ra_max, dec_min, ... | 0 | 0 | 0 | 0 | 0 | 719 | 0 | 0 | 46 |
be10b0d724e03294d196bc011b322a0131e5d9cc | 668 | py | Python | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | sample_list.py | xuanyuyt/libfacedetection | a2576ef7c5f35dd8bc64227b60948da8f4fd5d5e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding=utf-8 -*-
if __name__ == '__main__':
# ================================================================== #
# Select Sample List #
# ================================================================== #
output = open('ALL.txt', 'w')
with o... | 37.111111 | 90 | 0.378743 | # -*- coding=utf-8 -*-
import os
if __name__ == '__main__':
# ================================================================== #
# Select Sample List #
# ================================================================== #
output = open('ALL.txt', 'w')
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
cea272597e7c5a179183dd81f275ae2984ba6975 | 1,675 | py | Python | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | superb/urls.py | gheyderov/E-commerce-website | 9a87e8e6658a69fb017bdc3b36d6dc5417e3124e | [
"MIT"
] | null | null | null | """superb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.222222 | 84 | 0.699701 | """superb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
e8aeb956c1e734978949a081f9e6a6d6823a2d71 | 164 | py | Python | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | src/__main__.py | cesarabelfigueroa/FileSystem | fcd42f62ee406dbaf3180b0c15903c196c885e4a | [
"MIT"
] | null | null | null | main() | 20.5 | 41 | 0.75 | from classes.Shell import Shell
from classes.FileSystem import FileSystem
def main():
shell = Shell("./disk/Disk.bin")
shell.createRoot()
shell.execute()
main() | 0 | 0 | 0 | 0 | 0 | 61 | 0 | 30 | 67 |
539793bf8d49e145d5788dcd14ff3f0d24bf7a75 | 74 | py | Python | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | amadeus/version.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | null | null | null | version_info = (5, 3, 1)
version = '.'.join(str(v) for v in version_info)
| 24.666667 | 48 | 0.648649 | version_info = (5, 3, 1)
version = '.'.join(str(v) for v in version_info)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
516979c22c20cedc5cccce7806521c8edb663484 | 1,482 | py | Python | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | null | null | null | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | null | null | null | tests/migrations/0001_initial.py | ixc/wagtailstreamforms | 93bf352219608e803948cd28385566e0ca63fa7c | [
"MIT"
] | 1 | 2021-01-27T10:49:35.000Z | 2021-01-27T10:49:35.000Z | # Generated by Django 2.2.1 on 2019-05-17 19:15
| 34.465116 | 156 | 0.589069 | # Generated by Django 2.2.1 on 2019-05-17 19:15
from django.db import migrations, models
import django.db.models.deletion
import wagtailstreamforms.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailstreamforms', '0001_initial'),
]
operations = [
... | 0 | 0 | 0 | 1,302 | 0 | 0 | 0 | 41 | 90 |
83ff131905fef6cb336a239bba7b3fdd20edf5cf | 492 | py | Python | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | null | null | null | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | 5 | 2020-03-11T20:32:25.000Z | 2020-03-12T00:43:06.000Z | PyRaMD/integrate/velocity_verlet.py | adodin/simple_MD | 93d725e6cb3de9901b44967d75e3db9d726b936a | [
"MIT"
] | null | null | null | # Velocity Verlet Integrator as a Functor containing the integrator specs
| 32.8 | 73 | 0.603659 | # Velocity Verlet Integrator as a Functor containing the integrator specs
class VelocityVerlet:
# Initializes Integrator with time step & force field
def __init__(self, dt, force_field):
self.dt = dt
self.force_field = force_field
def __call__(self, x, v, m, *args, **kwargs):
a_1 ... | 0 | 0 | 0 | 395 | 0 | 0 | 0 | 0 | 23 |
e3bb77c5090710317d11e372d9d96a50cd00e5eb | 8,369 | py | Python | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | pyblockchain/blockchain.py | kadonoamino/python_blockchain | 2ef52bccc812f0f7c48e61256d125e196ad51bce | [
"MIT"
] | null | null | null | import logging
import sys
MINING_DIFFICULTY = 3
MINING_SENDER = 'THE BLOCKCHAIN'
MINING_REWARD = 1.0
MINING_TIMER_SEC = 20
BLOCKCHAIN_PORT_RANGE = (5000, 5003)
NEIGHBOURS_IP_RANGE_NUM = (0, 1)
BLOCKCHAIN_NEIGHBOURS_SYNC_TIME_SEC = 20
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
logger = logging.getLogg... | 35.163866 | 79 | 0.602342 | import contextlib
import hashlib
import json
import logging
import sys
import time
import threading
from ecdsa import NIST256p
from ecdsa import VerifyingKey
import requests
import utils
MINING_DIFFICULTY = 3
MINING_SENDER = 'THE BLOCKCHAIN'
MINING_REWARD = 1.0
MINING_TIMER_SEC = 20
BLOCKCHAIN_PORT_RANGE = (5000, 5... | 0 | 0 | 0 | 7,849 | 0 | 0 | 0 | -37 | 223 |
58059077979675f58d0fbc442c579293c01a16d0 | 3,683 | py | Python | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | Arrows.py | OceanNuclear/ComplexAnalysis | 7adccc0d81ea1216e305d35e248e6d886c682e6c | [
"MIT"
] | null | null | null | #!/home/ocean/anaconda3/bin/python3
from matplotlib import pyplot as plt
import seaborn as sns
#uses arrows to plot where each point lands after being transformed by the function
LongComputationalTime = False
x = np.linspace(-5,5, 50)
y = np.linspace(-5,5, 40)
startingPts = mymeshgrid(x,y)
#Oh yeah computer memory pro... | 39.180851 | 147 | 0.684768 | #!/home/ocean/anaconda3/bin/python3
from numpy import cos, arccos, sin, arctan, tan, pi, sqrt, e; from numpy import array as ary; import numpy as np; tau = 2*pi
from matplotlib import pyplot as plt
import seaborn as sns
#uses arrows to plot where each point lands after being transformed by the function
LongComputationa... | 0 | 0 | 0 | 0 | 0 | 813 | 0 | 39 | 176 |
5e3409be2e89ecf64071b4b6812018a6ca38c8c8 | 9,575 | py | Python | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 649 | 2016-09-09T07:38:19.000Z | 2022-03-28T04:30:55.000Z | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 362 | 2016-09-08T16:25:30.000Z | 2022-03-05T23:15:05.000Z | src/julia/pseudo_python_cli.py | dpinol/pyjulia | cec4bf0b0eac7e39cecd8f3e7882563062903d0f | [
"MIT"
] | 85 | 2016-11-08T09:32:44.000Z | 2022-03-03T13:10:37.000Z | """
Pseudo Python command line interface.
It tries to mimic a subset of Python CLI:
https://docs.python.org/3/using/cmdline.html
"""
from __future__ import absolute_import, print_function
import sys
from collections import namedtuple
try:
from types import SimpleNamespace
except ImportError:
ARGUMENT_HELP = ""... | 30.110063 | 85 | 0.552376 | """
Pseudo Python command line interface.
It tries to mimic a subset of Python CLI:
https://docs.python.org/3/using/cmdline.html
"""
from __future__ import absolute_import, print_function
import code
import copy
import runpy
import sys
import traceback
from collections import namedtuple
try:
from types import S... | 0 | 0 | 0 | 6,173 | 0 | 2,059 | 0 | -6 | 253 |
e39df32cb7e8758760f31753af692ff76943f2fa | 5,600 | py | Python | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/ui/wxgui/dialogs/trsinfodialog.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | |... | 38.095238 | 136 | 0.563393 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | |... | 0 | 0 | 0 | 3,162 | 0 | 0 | 0 | 245 | 224 |
b9df1422c289da33fd8f1fd710c8f912544cf226 | 14,741 | py | Python | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | utils/syn_functions.py | droidadroit/nasbot | f8d5d0ba8b77c37ebaa6cd2ab148a2633ff20207 | [
"MIT"
] | null | null | null | """
A collection of utilities for MF-GP Bandits.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# pylint: disable=super-on-old-class
import numpy as np
# Local imports
from ..opt.function_caller import get_euc_... | 42.976676 | 90 | 0.617462 | """
A collection of utilities for MF-GP Bandits.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# pylint: disable=super-on-old-class
import numpy as np
# Local imports
from ..opt.function_caller import get_euc_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
93c3a0380c312370c881e10fbe697c1f82ff806e | 8,417 | py | Python | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 32 | 2019-04-15T03:10:26.000Z | 2022-03-28T17:27:03.000Z | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 157 | 2019-02-21T03:13:57.000Z | 2022-03-09T19:13:59.000Z | bindings/pydairlib/lcm/process_lcm_log.py | Brian-Acosta/dairlib | 88da55d6e4378b93a787f3587d08b8a60f2f03f0 | [
"BSD-3-Clause"
] | 22 | 2019-03-02T22:31:42.000Z | 2022-03-10T21:28:50.000Z |
# Class to easily convert list of lcmt_osc_tracking_data_t to numpy arrays
| 38.967593 | 116 | 0.667578 | import dairlib
import drake
import numpy as np
# Class to easily convert list of lcmt_osc_tracking_data_t to numpy arrays
class lcmt_osc_tracking_data_t:
def __init__(self):
self.t = []
self.y_dim = 0
self.name = ""
self.is_active = []
self.y = []
self.y_des = []
self.error_y = []
se... | 0 | 0 | 0 | 1,267 | 0 | 6,980 | 0 | -19 | 111 |
4893f6a866e8ab79f5abd9ffd38994d1c37af014 | 14,032 | py | Python | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | navigation_old.py | mferg00/soccer-robot-ai | e25b685304fe671a0cccc17d666e9d22dc53e806 | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO
#########
# ENUMS #
#
############
# FUNCTIONS
# these should be very generic
###########
# VARIABLES
# used for condition checking or generic functions within navigation class
BALL_IN_DRIBBLER_DIST = 9 # min distance when ball is in the dribbler
BALL_IN_DRIBBLER_ANGLE = 15 ... | 30.438178 | 153 | 0.553521 | import RPi.GPIO as GPIO
from drive import Drive
from dribbler import Dribbler
from field import Field
from enum import Enum
from kicker import Kicker
import time
import numpy as np
#########
# ENUMS #
#
class state(Enum):
none = 1
ball_search = 2
go_to_ball = 3
goal_search = 4
go... | 0 | 0 | 0 | 12,659 | 0 | 362 | 0 | 3 | 311 |
e8cc4bd94d2a885ce94833f097eea32502e6fb37 | 5,842 | py | Python | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | null | null | null | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | 7 | 2020-03-24T15:55:32.000Z | 2021-08-23T20:43:13.000Z | DataMining/weather/cylinders.py | navijo/FlOYBD | beb4fb32598e955ce3b47ad647452c15a87cfae8 | [
"MIT"
] | 3 | 2017-07-26T11:46:05.000Z | 2018-04-29T12:07:59.000Z |
'''
https://github.com/LiquidGalaxyLAB/ViewYourData/blob/master/VYD_Project/VYD/Utils/PresentationManager/cylinder_generator.py
https://developers.google.com/maps/documentation/geocoding/intro?hl=es-419
'''
| 40.853147 | 156 | 0.626498 | import simplekml
import json
from polycircles import polycircles
import time
from subprocess import call
class CylindersKml(object):
def __init__(self, name, data):
self.name = name
self.data = data
self.kml_var = simplekml.Kml()
def makeKML(self):
current_milli_... | 0 | 0 | 0 | 5,482 | 0 | 0 | 0 | -5 | 140 |
58700b1ab5a6bb83d87d663e865662eaab49e36a | 45,318 | py | Python | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 20 | 2021-04-22T14:34:27.000Z | 2022-03-22T01:30:25.000Z | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 1 | 2021-05-18T12:09:19.000Z | 2021-05-19T04:23:49.000Z | plugins/bot_cockroach.py | opq-osc/botoy-plugins | 8889942cfb5d44c94705b6841cbd821ed6ee6b4b | [
"MIT"
] | 4 | 2021-06-13T04:21:09.000Z | 2022-01-06T12:13:22.000Z | """
+{}
"""
import base64
import random
from io import BytesIO
import httpx
from botoy import GroupMsg, S
from botoy import decorators as deco
from botoy.parser import group as gp
from PIL import Image
= Image.open(
BytesIO(
base64.b64decode(
"""
iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ct... | 69.082317 | 76 | 0.940553 | """
来点小强+{可选小强数量}
可以艾特一个人使用
"""
import base64
import random
from io import BytesIO
import httpx
from botoy import GroupMsg, S
from botoy import decorators as deco
from botoy.parser import group as gp
from PIL import Image
小强 = Image.open(
BytesIO(
base64.b64decode(
"""
iVBORw0KGgoAAAANSUhEUgA... | 240 | 851 | 0 | 0 | 0 | 353 | 0 | 0 | 23 |
17cc2151cef7cb62503e1ee06869d1ee88e9b6bb | 1,113 | py | Python | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | 1 | 2019-03-27T22:32:56.000Z | 2019-03-27T22:32:56.000Z | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | null | null | null | docs/_examples/mesh-smoothing.py | yijiangh/compas | a9e86edf6b602f47ca051fccedcaa88a5e5d3600 | [
"MIT"
] | null | null | null | """Smooth a mesh.
"""
from compas.datastructures import Mesh
from compas.geometry import smooth_area
import compas_rhino
__author__ = ['Tom Van Mele', 'Matthias Rippmann']
__copyright__ = 'Copyright 2017, BRG - ETH Zurich',
__license__ = 'MIT'
__email__ = 'van.mele@arch.ethz.ch'
# select a... | 25.295455 | 78 | 0.698113 | """Smooth a mesh.
"""
from compas.datastructures import Mesh
from compas.geometry import smooth_area
import compas_rhino
__author__ = ['Tom Van Mele', 'Matthias Rippmann']
__copyright__ = 'Copyright 2017, BRG - ETH Zurich',
__license__ = 'MIT'
__email__ = 'van.mele@arch.ethz.ch'
# select a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5c22083523c248ad1b2c6de86eb7566e358c791 | 7,922 | py | Python | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | tests/managers/event_log_tests.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """
SoftLayer.tests.managers.event_log_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
| 31.188976 | 99 | 0.454304 | """
SoftLayer.tests.managers.event_log_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
class EventLogTests(testing.TestCase):
def set_up(self):
self.event_log = SoftLay... | 0 | 0 | 0 | 7,674 | 0 | 0 | 0 | 12 | 89 |
96b5c9d649f8f78abe33dffa08a7507737a3b4c1 | 397 | py | Python | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 2 | 2019-03-26T23:47:40.000Z | 2020-03-28T03:23:31.000Z | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2019-03-27T10:59:14.000Z | 2019-03-27T10:59:14.000Z | sensors/MercurySwitchModule.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2018-07-14T23:55:14.000Z | 2018-07-14T23:55:14.000Z | import RPi.GPIO as GPIO
import time
#When the mercury is contact, we get a signal on 21
pin = 21
light = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
GPIO.setup(light, GPIO.OUT)
while True:
if GPIO.input(pin):
print("contact")
GPIO.output(light, GPIO.HIGH)
else:
print("no conta... | 18.045455 | 51 | 0.647355 | import RPi.GPIO as GPIO
import time
#When the mercury is contact, we get a signal on 21
pin = 21
light = 20
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
GPIO.setup(light, GPIO.OUT)
while True:
if GPIO.input(pin):
print("contact")
GPIO.output(light, GPIO.HIGH)
else:
print("no conta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
076d01cdee74927f3950a2f36d0c2aa2fc2d6a1b | 106 | py | Python | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/cli/defaults.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | _default_store = "dir"
_default_clevel = 3
_default_codec = "zstd"
_default_workers_backend = "threading"
| 21.2 | 38 | 0.792453 | _default_store = "dir"
_default_clevel = 3
_default_codec = "zstd"
_default_workers_backend = "threading"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b42e01b497eed8a4616e56359654df96530b2429 | 37,311 | py | Python | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 9 | 2017-10-10T12:24:23.000Z | 2021-08-18T14:07:51.000Z | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 1 | 2020-12-06T11:03:25.000Z | 2021-04-14T05:21:23.000Z | feersum_nlu/api/regex_entity_extractors_api.py | praekelt/feersum-nlu-api-wrappers | 6580e2bab2c8a764fe868a505330b3fee6029074 | [
"BSD-3-Clause"
] | 2 | 2019-02-12T08:26:06.000Z | 2022-02-01T09:39:47.000Z | # coding: utf-8
"""
FeersumNLU API
This is the HTTP API for Feersum NLU. See https://github.com/praekelt/feersum-nlu-api-wrappers for examples of how to use the API. # noqa: E501
OpenAPI spec version: 2.0.54.dev2
Contact: nlu@feersum.io
Generated by: https://github.com/swagger-api/swagger-codege... | 43.034602 | 180 | 0.637319 | # coding: utf-8
"""
FeersumNLU API
This is the HTTP API for Feersum NLU. See https://github.com/praekelt/feersum-nlu-api-wrappers for examples of how to use the API. # noqa: E501
OpenAPI spec version: 2.0.54.dev2
Contact: nlu@feersum.io
Generated by: https://github.com/swagger-api/swagger-codege... | 0 | 0 | 0 | 36,787 | 0 | 0 | 0 | 0 | 105 |
e232c85608e7357dcbea2b73496a2fb0667670b1 | 516 | py | Python | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | 3 | 2015-05-18T13:49:36.000Z | 2015-05-18T14:37:32.000Z | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bobjansen/django_fabv | cf8d1be8371c7574884f0405b6ca7f78a7c224b3 | [
"BSD-3-Clause"
] | null | null | null | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
setup(
name = 'django_fabv',
version = '0.1.1',
url = 'https://pypi.python.org/pypi/django_fabv/0.1.0',
include_package_data=True,
packages=find_packages(),
license = '3... | 27.157895 | 59 | 0.680233 | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
setup(
name = 'django_fabv',
version = '0.1.1',
url = 'https://pypi.python.org/pypi/django_fabv/0.1.0',
include_package_data=True,
packages=find_packages(),
license = '3... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
536290ee2514884e41f360d3529e625d5173f659 | 707 | py | Python | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2018/Ernesto Vela/Practica1Parcial2/ocp2.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z |
programmer = Programmer()
tester = Tester()
project = ProjectManagement()
print(project.process(programmer))
print(project.process(tester))
#La clase ProjectManagment es la que se puede extender
#por eso la dejamos asi, ya que cumple con el principio
#Abierto/Cerrado
#(no le entendi muy bien)
| 19.638889 | 55 | 0.670438 | class Programmer:
def code(self):
return 'I am Coding!'
class Tester:
def test(self):
return 'I am Testing!'
class ProjectManagement:
def process(self, worker):
if isinstance(worker, Programmer):
return worker.code()
elif isinstance(worker, Tester):
r... | 0 | 0 | 0 | 338 | 0 | 0 | 0 | 0 | 68 |
89e3547e029cf9e6f7b297217cd7135285370c2d | 15,695 | py | Python | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 5 | 2018-09-25T05:49:49.000Z | 2021-12-30T11:06:09.000Z | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 3 | 2018-04-01T04:27:21.000Z | 2019-01-03T11:02:33.000Z | rock4/softtest/pad/hierarchy/driver.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 7 | 2018-09-25T05:49:51.000Z | 2021-12-30T11:06:11.000Z | # -*- encoding: utf-8 -*-
'''
Current module: mobile.monkeyrunner.driver
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo()
MAIL: lkf20031988@163.com
RCS: rock4.softtest.pad.hiera... | 33.680258 | 140 | 0.568652 | # -*- encoding: utf-8 -*-
'''
Current module: mobile.monkeyrunner.driver
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: rock4.softtest.pad.hi... | 387 | 10,858 | 0 | 1,914 | 0 | 0 | 0 | -4 | 48 |
fa017755b8936f4b18dedb46a5a32403feb76580 | 452 | py | Python | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | app/api/v1/models/usermodels.py | kiruidavid/SendIT254 | ee14fdcd0964d18cc93312aec39987a0753e09f1 | [
"MIT"
] | null | null | null | users = []
| 13.294118 | 67 | 0.579646 | users = []
class Users(object):
def __init__(self):
self.db = users
def create_account(self, email, phone_number, user_name, password):
account = {
"user_id": str(len(users) + 1),
"email": email,
"phone_number": phone_number,
"user_name": user_name,
"password... | 0 | 0 | 0 | 48 | 0 | 311 | 0 | 0 | 70 |
a2064944d6fc7908c704e0375eec3db9c30f3880 | 2,787 | py | Python | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | core.py | vitus9988/arcalive_con_downloader | 5e1612ab015565f95da0dba68e302375fc827695 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
#main('https://arca.live/e/56?target=title&keyword=%EB%9D%BC%EC%98%A4&sort=rank&p=1')
con_download() | 30.626374 | 146 | 0.527449 | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
import urllib.request
from moviepy.video.io.VideoFileClip import VideoFileClip
import os
def wc(url):
headers = {
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.... | 132 | 0 | 0 | 0 | 0 | 2,302 | 0 | 25 | 240 |
c82e1da6da58dbb8b151c18c5241dc8a78e80db8 | 5,215 | py | Python | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | core/commands/create_domain.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # ============================================================================
#
# Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | 42.398374 | 123 | 0.653883 | # ============================================================================
#
# Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | 0 | 0 | 0 | 0 | 0 | 3,646 | 0 | 0 | 23 |
c56c8fcafd417e7a3375947337c8289dd86cfdbd | 781 | py | Python | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 5 | 2021-08-14T15:58:29.000Z | 2022-02-24T23:11:19.000Z | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 2 | 2021-09-15T12:32:28.000Z | 2022-01-10T02:32:31.000Z | urlunquote.py | kmorwood/mrequests | 957b9a7496cb7514cb3c1270883f40e038a7e1ce | [
"MIT"
] | 1 | 2021-11-28T16:46:04.000Z | 2021-11-28T16:46:04.000Z | def unquote(string):
"""Decode and replace URL percent-escapes in string.
unquote('abc%20def') -> b'abc def'.
Note: If a string, not a bytes object, is passed, it is encoded as UTF-8.
This is only an issue if it contains unescaped non-ASCII characters, which
URIs should not.
"""
if no... | 22.970588 | 78 | 0.564661 | def unquote(string):
"""Decode and replace URL percent-escapes in string.
unquote('abc%20def') -> b'abc def'.
Note: If a string, not a bytes object, is passed, it is encoded as UTF-8.
This is only an issue if it contains unescaped non-ASCII characters, which
URIs should not.
"""
if no... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2127d7f5da8e00b3ae835b2e11ef891db0f2c08f | 664 | py | Python | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | meeting_room_booking_service/app/models/meeting_room_reservation.py | cassioeskelsen/microservice_boilerplate | c2c09d93095cc87e54f70095e74f13a97458e7d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
| 26.56 | 113 | 0.680723 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from mongoengine import EmbeddedDocument, StringField, Document, EmailField, EmbeddedDocumentField, DateTimeField
class Room(EmbeddedDocument):
name = StringField()
class Employeer(EmbeddedDocument):
name = StringField()
class RoomReservation(Document):
... | 0 | 0 | 0 | 434 | 0 | 0 | 0 | 92 | 91 |
b2f1e5909e2fbd5772b468609d91bf3631253923 | 358 | py | Python | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | 5 | 2019-10-14T13:50:02.000Z | 2021-09-23T18:48:27.000Z | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null | tests/test_common/test_nano.py | CraftSpider/SpiderTools | 4bf155feec7cb983e8d283d93552902ec85178a2 | [
"MIT"
] | null | null | null |
import spidertools.common.nano as nano
| 22.375 | 65 | 0.701117 |
import spidertools.common.nano as nano
import os
async def test_nanoclient():
client = nano.NanoClient("talosbot", os.getenv("TALOS_PSWD"))
await client.init()
marcy = await client.get_user("marcyt")
projects = await marcy.get_projects()
user = await projects[0].get_user()
assert marcy == us... | 0 | 0 | 284 | 0 | 0 | 0 | 0 | -12 | 45 |
bdc017c5baa8abcf99007f79e8a9e29fed22cec4 | 1,077 | py | Python | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null | python/reciept.py | AlexShukhman/smop-backend-PUBLIC | d0f54d963bc0a3860181213049f7f26851badcaa | [
"Apache-2.0"
] | null | null | null |
"""
This script is for creating receipts for Smop coders using data given from mongo
"""
if __name__ == '__main__':
main() | 25.046512 | 80 | 0.652739 | import json, os, sys
from openpyxl import load_workbook
"""
This script is for creating receipts for Smop coders using data given from mongo
"""
def readIn():
lines = sys.stdin.readlines()
return json.loads(lines[0])
def main():
lines = readIn()
#Ensure in correct directory
directory_name = './a... | 0 | 0 | 0 | 0 | 0 | 847 | 0 | 12 | 90 |
050cd1985aea466a75989d2e36e84cd9e064860b | 3,740 | py | Python | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | applications/welcome/controllers/meteoritepage.py | winmill2/CS-411-UFO-Meteorite-Finder | 8a3ae102a18df6a6f45fc425383dfa0facb61d13 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# try something like
if not session.met_index:
session.met_index = 0
if not session.met_sort:
session.met_sort = 'ID'
if not session.met_display_flash:
session.met_display_flash = 'No'
if not session.met_filter_cat:
session.met_filter_cat = 'ID'
session.met_filter_text = ... | 34 | 143 | 0.663636 | # -*- coding: utf-8 -*-
# try something like
if not session.met_index:
session.met_index = 0
if not session.met_sort:
session.met_sort = 'ID'
if not session.met_display_flash:
session.met_display_flash = 'No'
if not session.met_filter_cat:
session.met_filter_cat = 'ID'
session.met_filter_text = ... | 0 | 0 | 0 | 0 | 0 | 3,275 | 0 | 0 | 138 |
97a694e5b108ae18df8c6c74128996964290ff48 | 7,413 | py | Python | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 17 | 2020-11-13T12:24:28.000Z | 2021-09-03T08:47:15.000Z | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 22 | 2020-11-06T16:23:47.000Z | 2021-07-09T16:19:25.000Z | checks/drc_checks/magic/magic_gds_drc_check.py | efabless/google_mpw_precheck | b30e779ab0ff90e37e5c56795066a30804816e13 | [
"Apache-2.0"
] | 14 | 2020-11-13T12:24:33.000Z | 2021-08-13T03:14:30.000Z | import argparse
import logging
from pathlib import Path
try:
from checks.drc_checks.magic.converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_drc_to_tr_drc, tr2klayout
except ImportError:
def violations_count(drc_content):
"""
design name
violation message
list of violations... | 47.825806 | 140 | 0.70835 | import argparse
import gzip
import logging
import os
import re
import subprocess
from pathlib import Path
try:
from checks.drc_checks.magic.converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_drc_to_tr_drc, tr2klayout
except ImportError:
from converters import magic_drc_to_rdb, magic_drc_to_tcl, magic_... | 0 | 0 | 0 | 0 | 0 | 4,952 | 0 | 31 | 183 |
d23a830cb4e13b7e73b64bf53b38781e2f971948 | 3,133 | py | Python | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | null | null | null | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | 2 | 2021-12-14T04:07:24.000Z | 2021-12-15T23:28:54.000Z | auth_service.py | open-bms/open-bms-core | 36d9e2992f9dedeb5794f49993bfdb8da3fe4be7 | [
"MIT"
] | null | null | null | """The auth service module configures the flask app for the OpenBMS auth service.
The auth service provides an API for managing and authenticating user accounts. Users
may authenticate through a number of supported identity provides using SAML or through a
native OpenBMS account using an email address and password. Th... | 33.688172 | 88 | 0.721673 | """The auth service module configures the flask app for the OpenBMS auth service.
The auth service provides an API for managing and authenticating user accounts. Users
may authenticate through a number of supported identity provides using SAML or through a
native OpenBMS account using an email address and password. Th... | 0 | 663 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
11482d584e2b935307aae8ac905f448fa6b0334e | 1,119 | py | Python | cnn_code/download.py | neurocaience/deepfreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | 1 | 2020-11-17T06:41:10.000Z | 2020-11-17T06:41:10.000Z | cnn_code/download.py | neurocaience/DeepFreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | null | null | null | cnn_code/download.py | neurocaience/DeepFreeze | 2a8c7da7519df2bacb640917695bd7d226e8d4f4 | [
"MIT"
] | 1 | 2020-06-18T04:25:48.000Z | 2020-06-18T04:25:48.000Z | """=============================================================================
Download experimental directory.
============================================================================="""
import argparse
import os
# ------------------------------------------------------------------------------
def mkdir(direc... | 31.971429 | 80 | 0.416443 | """=============================================================================
Download experimental directory.
============================================================================="""
import argparse
import os
# ------------------------------------------------------------------------------
def mkdir(direc... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79370707ea19958677a1687502db406a21323fe7 | 576 | py | Python | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | test/tablature_test.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | ################################################################################
# User Libs
import test.unittest as unittest
# Std Libs
################################################################################
################################################################################
if __... | 27.428571 | 81 | 0.401042 | ################################################################################
# User Libs
import test_utils
import test.unittest as unittest
import tablature as tab
# Std Libs
import os
################################################################################
class TestTablature(unittest.Tes... | 0 | 0 | 0 | 132 | 0 | 0 | 0 | -14 | 96 |
758fa9c537d5f3560f051905e3a75eea1d8a820b | 77 | py | Python | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | ofcourse/tests/__main__.py | liam-middlebrook/ofCourse | e93dc1b7fa825ad130a2b2a6eb8b5048e2c4005d | [
"Apache-2.0"
] | null | null | null | import test_yaml
import test_new
test_yaml.run_tests()
test_new.run_tests()
| 12.833333 | 21 | 0.831169 | import test_yaml
import test_new
test_yaml.run_tests()
test_new.run_tests()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0915537fd83ad76cc12260da6e25dbff6438a263 | 1,718 | py | Python | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 25 | 2022-03-05T08:26:52.000Z | 2022-03-30T15:45:42.000Z | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 219 | 2022-03-04T17:29:12.000Z | 2022-03-31T21:16:14.000Z | ietf/utils/models.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 22 | 2022-03-04T15:34:34.000Z | 2022-03-28T13:30:59.000Z | # Copyright The IETF Trust 2015-2020, All Rights Reserved
import itertools
def object_to_dict(instance):
"""
Similar to django.forms.models.model_to_dict() but more comprehensive.
Taken from https://stackoverflow.com/questions/21925671/#answer-29088221
with a minor tweak: .id --> .pk
"""
... | 38.177778 | 95 | 0.708382 | # Copyright The IETF Trust 2015-2020, All Rights Reserved
import itertools
from django.db import models
class DumpInfo(models.Model):
date = models.DateTimeField()
host = models.CharField(max_length=128)
tz = models.CharField(max_length=32, default='UTC')
class VersionInfo(models.Model):
time ... | 0 | 0 | 0 | 973 | 0 | 0 | 0 | 7 | 127 |
0a6321c2240f9ea7f8a93b45daf5ef2dc3b73b95 | 11,227 | py | Python | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/test_config.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | """Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import unittest.mock as mock
import homeassistant.config as config_util
from homeassistant.util import dt as dt_util
from tests.common import (get_test_config_dir)
CONFIG_DIR = get_test_config_dir()
YAML_PATH = os.path.join(... | 35.528481 | 77 | 0.625367 | """Test config utils."""
# pylint: disable=too-many-public-methods,protected-access
import os
import tempfile
import unittest
import unittest.mock as mock
import pytest
from voluptuous import MultipleInvalid
from homeassistant.core import DOMAIN, HomeAssistantError, Config
import homeassistant.config as config_util
f... | 0 | 3,722 | 0 | 6,468 | 0 | 0 | 0 | 291 | 179 |
b6635285c7d00ae82d0c261aeba71329a67efc08 | 14,586 | py | Python | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 1 | 2018-03-16T23:25:10.000Z | 2018-03-16T23:25:10.000Z | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 2 | 2020-07-26T02:42:48.000Z | 2022-03-23T16:37:49.000Z | ipf/glue2/compute.py | pauldalewilliams/ipf | 2bee1746d74724105a88b6b152bab4318ff32bfd | [
"Apache-2.0"
] | 3 | 2020-06-15T18:20:15.000Z | 2021-05-25T15:50:35.000Z |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | 44.066465 | 189 | 0.593857 |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... | 0 | 0 | 0 | 10,602 | 0 | 0 | 0 | 949 | 671 |
7268716acc82c2e94387b7f98b37eb3a235bba97 | 488 | py | Python | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 5 | 2021-12-17T00:18:44.000Z | 2021-12-29T05:18:47.000Z | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 6 | 2021-12-20T17:57:21.000Z | 2021-12-29T10:29:04.000Z | src/azure_keyvault_browser/widgets/__init__.py | samdobson/azure-keyvault-browser | 7e7200dad34f668e477229fe3698e59195b68a78 | [
"MIT"
] | 1 | 2021-12-20T15:06:03.000Z | 2021-12-20T15:06:03.000Z | from .filter import FilterWidget
from .flash import FlashWidget, ShowFlashNotification
from .header import HeaderWidget
from .help import HelpWidget
from .secret_properties import SecretPropertiesWidget
from .secret_versions import SecretVersionsWidget
from .secrets import SecretsWidget
__all__ = (
"SecretsWidget"... | 25.684211 | 53 | 0.776639 | from .filter import FilterWidget
from .flash import FlashWidget, ShowFlashNotification
from .header import HeaderWidget
from .help import HelpWidget
from .secret_properties import SecretPropertiesWidget
from .secret_versions import SecretVersionsWidget
from .secrets import SecretsWidget
__all__ = (
"SecretsWidget"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
97cd577d5266057515b84c623a4e2cb5632a6417 | 382 | py | Python | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 18 | 2020-04-13T03:14:06.000Z | 2022-03-09T18:54:41.000Z | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | null | null | null | Section 18/4.Document-scope-of-the-variables.py | airbornum/-Complete-Python-Scripting-for-Automation | bc053444f8786259086269ca1713bdb10144dd74 | [
"MIT"
] | 22 | 2020-04-29T21:12:42.000Z | 2022-03-17T18:19:54.000Z |
main()
| 11.235294 | 32 | 0.599476 | def myfunction1():
x=60 #This is local variable
print("Welcome to functions")
print("x value from fun1: ",x)
#myfunction2()
return None
def myfunction2(y): #Parameter
print("Thank you!!")
print("x value from fun2: ",y)
return None
def main():
#global x
x=10
myfunction1()
myfunction2(x... | 0 | 0 | 0 | 0 | 0 | 273 | 0 | 0 | 73 |
cbbef13972885989e5977242841f369812ccf86f | 5,437 | py | Python | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-04-16T08:13:31.000Z | 2020-05-18T14:03:06.000Z | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 310 | 2015-02-11T00:30:09.000Z | 2021-07-14T23:58:50.000Z | tests/fixtures/test_funding_awards_json/content_05_expected.py | elifesciences/elife-tools | ee345bf0e6703ef0f7e718355e85730abbdfd117 | [
"MIT"
] | 9 | 2015-02-04T01:21:28.000Z | 2021-06-15T12:50:47.000Z | # coding=utf-8
from collections import OrderedDict
expected = [
OrderedDict(
[
("id", u"par-1"),
(
"source",
OrderedDict(
[
("funderId", u"10.13039/100006978"),
(
... | 29.389189 | 105 | 0.22586 | # coding=utf-8
from collections import OrderedDict
expected = [
OrderedDict(
[
("id", u"par-1"),
(
"source",
OrderedDict(
[
("funderId", u"10.13039/100006978"),
(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1859eec29c6660f3e68c133f3169370664e0a82a | 114 | py | Python | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | apps/web/admin.py | fabioanderegg/code_annotate | 671c5f2b1eee30dffb85e58ce961e18d3344bc94 | [
"MIT"
] | null | null | null | from django.contrib import admin
from apps.web.models import CodeAnnotation
admin.site.register(CodeAnnotation)
| 19 | 42 | 0.842105 | from django.contrib import admin
from apps.web.models import CodeAnnotation
admin.site.register(CodeAnnotation)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a29fc96079d39943724101eb7ecfb452bcb65d11 | 254 | py | Python | splintr/__init__.py | shreykshah/splintr | 1fc2580606c1ccfe36ad13be68794e69c450ed05 | [
"Apache-2.0"
] | 2 | 2021-01-18T07:12:28.000Z | 2021-01-18T07:12:43.000Z | splintr/__init__.py | vsrin1/splintr | 218a268dd8cc3aa02e1adc69ab556922f6e01a11 | [
"Apache-2.0"
] | null | null | null | splintr/__init__.py | vsrin1/splintr | 218a268dd8cc3aa02e1adc69ab556922f6e01a11 | [
"Apache-2.0"
] | 2 | 2020-07-18T15:38:19.000Z | 2020-07-18T20:35:10.000Z | __all__ = ['DataParallel', 'ModelParallel', 'benchmarks', 'dataparallel', 'modelparallel']
from .DataParallel import DataParallel
from .ModelParallel import ModelParallel
import splintr.benchmarks
import splintr.dataparallel
| 36.285714 | 90 | 0.830709 | __all__ = ['DataParallel', 'ModelParallel', 'benchmarks', 'dataparallel', 'modelparallel']
from .DataParallel import DataParallel
from .ModelParallel import ModelParallel
import splintr.benchmarks
import splintr.dataparallel
import splintr.modelparallel
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
7fca4dacf6508d4beaf221a6e17c5e956d2bb365 | 141 | py | Python | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | test/__init__.py | CjwRiver/apiAutoTest | 35f1c2475e76dd34089e2cee33b351a1ca97c168 | [
"MIT"
] | null | null | null | #!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: cjw
@file: __init__.py.py
@ide: PyCharm
@time: 2020/7/31
""" | 15.666667 | 22 | 0.638298 | #!/usr/bin/env/python3
# -*- coding:utf-8 -*-
"""
@project: apiAutoTest
@author: cjw
@file: __init__.py.py
@ide: PyCharm
@time: 2020/7/31
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a7b5fda502bc31c6581fe21da183c411caabf7c | 8,331 | py | Python | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | purge-user.py | appaegis/api-script-samples | f5445b351411fe858e2130e47b28befccc6262e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import argparse
from lib.common import booleanString
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Remove existing user and associated objects')
parser.add_argument('--dryrun', dest='dryrun', type=booleanString, default=True,
r... | 42.28934 | 121 | 0.723443 | #!/usr/bin/env python
# coding: utf-8
import logging
import argparse
import pydash
from lib.common import USER_EMAIL
from lib.common import API_KEY
from lib.common import API_SECRET
from lib.common import USER_API
from lib.common import TEAM_API
from lib.common import ROLE_API
from lib.common import POLICY_API
from ... | 0 | 0 | 0 | 0 | 0 | 7,260 | 0 | 133 | 357 |
7d59636da25ea632171a4002c1c95bd69b16a857 | 946 | py | Python | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | hanoi.py | PanzeriT/hanoi | 7817bda536d059f438c9268c5f0c6a40ef78ca94 | [
"MIT"
] | null | null | null | from typing import TypeVar
T = TypeVar('T')
if __name__ == '__main__':
discs: int = 5
tower_a: Stack[int] = Stack()
tower_b: Stack[int] = Stack()
tower_c: Stack[int] = Stack()
for i in range(discs, 0, -1):
tower_a.push(i)
print(tower_a, tower_b, tower_c)
hanoi(tower_a, tower_c,... | 23.073171 | 80 | 0.581395 | from typing import TypeVar, Generic, List
T = TypeVar('T')
class Stack(Generic[T]):
def __init__(self) -> None:
self._container: List[T] = []
def push(self, item: T) -> None:
self._container.append(item)
def pop(self) -> T:
return self._container.pop()
def __repr__(self) -... | 0 | 0 | 0 | 280 | 0 | 268 | 0 | 15 | 46 |
96e121827578905e3826a776de058f40e9f17b21 | 1,076 | py | Python | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | 1 | 2020-07-16T05:01:16.000Z | 2020-07-16T05:01:16.000Z | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | null | null | null | code/tests/test_prepare/test_utils.py | evolaemp/svmcc | c57c92c6b97f57ab8f7bc20ac06c1c77d96c5143 | [
"MIT"
] | 2 | 2017-04-29T07:29:53.000Z | 2020-07-16T16:48:42.000Z | import os.path
from code.cli import TESTS_DIR
FIXTURE_DATASET = os.path.join(TESTS_DIR, 'fixtures/GER.tsv')
FIXTURE_DATASET_ASJP = os.path.join(TESTS_DIR, 'fixtures/Afrasian.tsv')
| 26.9 | 71 | 0.754647 | import os.path
from unittest import TestCase
from code.cli import PARAMS_DIR, TESTS_DIR
from code.prepare.base import load_data
from code.prepare.params import load_params
from code.prepare.utils import *
FIXTURE_DATASET = os.path.join(TESTS_DIR, 'fixtures/GER.tsv')
FIXTURE_DATASET_ASJP = os.path.join(TESTS_DIR, ... | 12 | 0 | 0 | 700 | 0 | 0 | 0 | 71 | 113 |
96f83df3d849dd9cc0fc7a9ffc76ce58dd3d7421 | 6,356 | py | Python | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2019-03-19T14:45:28.000Z | 2019-03-19T14:45:28.000Z | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | null | null | null | python/uw/data/timed_data.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2018-08-24T18:58:27.000Z | 2018-08-24T18:58:27.000Z | """
Process time data set
see create_timed_data to generate files with times for all
Extract a single data set around a cone with TimedData
"""
import os, glob, pickle
import healpy
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time, TimeDelta
from . import binned_dat... | 38.993865 | 111 | 0.599434 | """
Process time data set
see create_timed_data to generate files with times for all
Extract a single data set around a cone with TimedData
"""
import os, glob, pickle
import healpy
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from astropy.time import Time, TimeDelta
from . import binned_dat... | 0 | 0 | 0 | 4,048 | 0 | 77 | 0 | 0 | 68 |
aaa5afe2a6b97519f2ef121d1b8310c6670e70c9 | 399 | py | Python | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | 8 | 2021-09-24T18:48:59.000Z | 2021-11-09T18:54:44.000Z | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | null | null | null | bot.py | AdrianoBinhara/RegisterBot | 234fe49de32f8449ee30059e65fd0523ae9e16f4 | [
"MIT"
] | 2 | 2021-09-25T12:49:06.000Z | 2021-09-29T04:39:00.000Z | from discord.ext import commands
from decouple import config
bot = commands.Bot("!")
load_cogs(bot)
TOKEN = config("TOKEN")
bot.run(TOKEN)
| 18.136364 | 49 | 0.646617 | from discord.ext import commands
import os
from decouple import config
bot = commands.Bot("!")
def load_cogs(bot):
bot.load_extension("manager")
bot.load_extension("tasks.purge")
for file in os.listdir("commands"):
if file.endswith(".py"):
cog = file[:-3]
bot.load_extensi... | 0 | 0 | 0 | 0 | 0 | 222 | 0 | -12 | 45 |
ca8bad046acf42a1b6463df94d5faf8e7e548b29 | 219 | py | Python | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | game/__init__.py | Randomneo/python_game | b5a4f399e092ff84a813509380156d0f91a761fa | [
"WTFPL"
] | null | null | null | from .core.vector2 import Vector2
screen_size = width, height = 1040, 480
map_size = Vector2(x=10000, y=1000)
gravity = 1.5
| 18.25 | 39 | 0.671233 | from enum import Enum
from .core.vector2 import Vector2
screen_size = width, height = 1040, 480
map_size = Vector2(x=10000, y=1000)
gravity = 1.5
class Colors(Enum):
black = (0, 0, 0)
white = (255, 255, 255)
| 0 | 0 | 0 | 48 | 0 | 0 | 0 | 0 | 45 |
be9918c89550f09504e0af7a94d005b3d72c1c51 | 5,052 | py | Python | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 13 | 2019-12-09T07:56:13.000Z | 2021-08-03T01:45:53.000Z | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 1 | 2020-04-29T00:00:14.000Z | 2021-07-09T14:24:19.000Z | ingesters/youtube/search.py | skratchdot/media-tools | bca0c683fb637aeefda1c49454a118f809047d97 | [
"MIT"
] | 3 | 2020-04-27T15:36:36.000Z | 2021-03-29T17:52:35.000Z | # -*- coding: utf-8 -*-
# Search API docs: https://developers.google.com/youtube/v3/docs/search/list
# Search API Python docs: https://developers.google.com/resources/api-libraries/documentation/youtube/v3/python/latest/youtube_v3.search.html
# Examples: https://github.com/youtube/api-samples/tree/master/python
impor... | 37.422222 | 182 | 0.64034 | # -*- coding: utf-8 -*-
# Search API docs: https://developers.google.com/youtube/v3/docs/search/list
# Search API Python docs: https://developers.google.com/resources/api-libraries/documentation/youtube/v3/python/latest/youtube_v3.search.html
# Examples: https://github.com/youtube/api-samples/tree/master/python
impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 111 |
b33e830b1007fc54e85f27112bd5b96f20551d3c | 8,472 | py | Python | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 32 | 2017-10-17T09:59:46.000Z | 2022-01-23T11:39:31.000Z | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 91 | 2017-07-13T15:43:15.000Z | 2022-02-21T13:06:35.000Z | bubuku/controller.py | zalando-nakadi/bubuku | 5738cc9309ed46e86fcad41b6fb580ddd69af8fd | [
"MIT"
] | 3 | 2018-04-19T13:13:00.000Z | 2018-09-11T05:59:38.000Z | import logging
_LOG = logging.getLogger('bubuku.controller')
| 40.535885 | 118 | 0.608357 | import logging
from time import time
from typing import Tuple, Optional
from bubuku.broker import BrokerManager
from bubuku.communicate import sleep_and_operate
from bubuku.env_provider import EnvProvider
from bubuku.zookeeper import BukuExhibitor
_LOG = logging.getLogger('bubuku.controller')
class Change(object):
... | 0 | 0 | 0 | 7,963 | 0 | 117 | 0 | 101 | 225 |
ea7f69405d55960dd53034f6c6f8fca3da210fe6 | 1,312 | py | Python | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | roman-to-integer/solution.py | thehimel/problem-solving | b7cd019e50895a0d2438947a0a826774eb7ce82f | [
"MIT"
] | null | null | null | def integer(roman):
"""
Function to convert a roman numeral to integer.
:type roman: str
:rtype: int
"""
# Initialize a dictionary of symbol and values
symbol_value = {
'M': 1000,
'D': 500,
'C': 100,
'L': 50,
'X': 10,
'V': 5,
'I': 1
... | 23.428571 | 76 | 0.567073 | def integer(roman):
"""
Function to convert a roman numeral to integer.
:type roman: str
:rtype: int
"""
# Initialize a dictionary of symbol and values
symbol_value = {
'M': 1000,
'D': 500,
'C': 100,
'L': 50,
'X': 10,
'V': 5,
'I': 1
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b3f4acf49e4b6dc2a76d42d703ee2157fa96ee9 | 1,057 | py | Python | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0088.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 23.488889 | 75 | 0.434248 | import unittest
class Solution:
def merge(self, nums1, m, nums2, n):
"""
:type nums1: List[int]
:type m: int
:type nums2: List[int]
:type n: int
:rtype: void Do not return anything, modify nums1 in-place instead.
"""
hi = m + n - 1
m -= 1
... | 0 | 0 | 0 | 944 | 0 | 0 | 0 | 0 | 46 |
8ff3e9267e1da09adc5fb8a5ff21ae54a517201e | 64,575 | py | Python | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 20 | 2021-03-20T05:06:41.000Z | 2022-02-16T08:25:46.000Z | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 47 | 2021-01-29T21:04:57.000Z | 2022-03-18T11:53:44.000Z | samap/analysis.py | vishalbelsare/SAMap | 2a2170496019f37dda113bb52bb55169825f7e05 | [
"MIT"
] | 6 | 2021-02-12T18:07:05.000Z | 2022-03-09T01:02:06.000Z | from . import q, pd, sp, np, warnings, sc
from .utils import to_vo, to_vn, substr, df_to_dict
from samalg import SAM
from scipy.stats import rankdata
def GOEA(target_genes,GENE_SETS,df_key='GO',goterms=None,fdr_thresh=0.25,p_thresh=1e-3):
"""Performs GO term Enrichment Analysis using the hypergeometric distribut... | 39.065336 | 157 | 0.556392 | import sklearn.utils.sparsefuncs as sf
from . import q, ut, pd, sp, np, warnings, sc
from .utils import to_vo, to_vn, substr, df_to_dict, sparse_knn, prepend_var_prefix
from samalg import SAM
from scipy.stats import rankdata
def _log_factorial(n):
return np.log(np.arange(1,n+1)).sum()
def _log_binomial(n,k):
... | 0 | 0 | 0 | 19,452 | 0 | 3,668 | 0 | 60 | 310 |
96b6e0621d791d164add30bfcebd7a97b026a24f | 2,329 | py | Python | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | teste.py | danielrodrigues97/Teste_Pratico_Publca | c4a48f2fd86ee371ae593ec4ffc440fe527d2a9b | [
"MIT"
] | null | null | null | # -*- coding:UTF-8 -*-
reqMax = []
reqMin = []
cont = 0
#print(limpar())
p = 0
while p != 4:
print('~'*30)
print('Para Inserir dados do jogo aperte [1]: ')
print('Para consultar dados dos jogos aperte [2]: ')
print('para limpar a tabela de jogos aperte [3]')
print('Para Sair d... | 24.010309 | 72 | 0.509661 | # -*- coding:UTF-8 -*-
import sys
reqMax = []
reqMin = []
cont = 0
def limpar ():
with open('tabela_jogos.txt', 'w') as arquivo:
arquivo.close
global cont
cont = 0
reqMax.clear()
reqMin.clear()
def consulta ():
print('~'*30)
linha = open('tabela_jogos.txt','r')
leitura = ... | 18 | 0 | 0 | 0 | 0 | 1,584 | 0 | -11 | 95 |
416556fc1a0a4d093835838d768bf3c2f23c309f | 597 | py | Python | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 5 | 2018-08-07T07:01:04.000Z | 2021-03-19T00:16:59.000Z | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 1 | 2018-04-30T07:27:03.000Z | 2018-04-30T07:27:03.000Z | app/templatetags/messages.py | augustakingfoundation/queryjane_app | 2c7b27db9e16288c49520b94704246b25dd262b6 | [
"MIT"
] | 3 | 2018-08-08T11:57:01.000Z | 2020-10-02T05:42:13.000Z | from django import template
register = template.Library()
| 20.586207 | 40 | 0.743719 | from django import template
from account.models import UserMessage
from account.models import Conversation
register = template.Library()
@register.assignment_tag
def get_user_messages_count(user):
return UserMessage.objects.filter(
user_to=user,
).count()
@register.assignment_tag
def get_new_user_... | 0 | 386 | 0 | 0 | 0 | 0 | 0 | 35 | 114 |
1504c2faa52e511b14f1969c5baf3ba4565022ac | 3,368 | py | Python | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 56 | 2019-10-20T03:09:02.000Z | 2022-03-25T09:21:40.000Z | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 3 | 2020-10-01T07:33:51.000Z | 2021-05-12T03:40:57.000Z | run_scripts/plot_fetch_eval.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 10 | 2019-11-04T16:56:09.000Z | 2022-03-25T09:21:41.000Z | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os.path as osp
import joblib
MAIN_PATH = '/scratch/gobi2/kamyar/oorl_rlkit/output'
WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
dat... | 39.623529 | 115 | 0.655582 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os.path as osp
import joblib
MAIN_PATH = '/scratch/gobi2/kamyar/oorl_rlkit/output'
WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
# WHAT_TO_PLOT = 'faster_all_eval_stats.pkl'
dat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a449f75f76ba154fd1a52ce57663d5dace977604 | 2,566 | py | Python | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | int_to_line.py | CUUATS/feature-class-sync | 05bf8e44f5721655e9bb71590849af460ec0256a | [
"BSD-3-Clause"
] | null | null | null | #int_to_line.py
#This script takes intersection and road segment and determine the direction of the road segment in contrast to the intersection.
import arcpy
from arcpy import env
arcpy.CheckOutExtension("Spatial")
arcpy.env.overwriteOutput = True
#input configuration
env.workspace = "C:/Users/kml42638/Desktop/testD... | 26.729167 | 129 | 0.601715 | #int_to_line.py
#This script takes intersection and road segment and determine the direction of the road segment in contrast to the intersection.
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
arcpy.env.overwriteOutput = True
#input configuration
env.workspace = "C:/Users... | 0 | 0 | 0 | 0 | 0 | 1,912 | 0 | 1 | 160 |
f9989169a6208962fd766e65aab7abac678b046b | 318 | py | Python | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | cactusco/celery.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cactusco.settings')
app = Celery('cactusco')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
| 26.5 | 69 | 0.742138 | import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cactusco.settings')
app = Celery('cactusco')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
def debug_task(self):
print(f'Request: {self.request!r}') | 0 | 63 | 0 | 0 | 0 | 0 | 0 | 0 | 24 |
9424aef899235c1a9aa2de958ac45e3889e4b3b5 | 3,306 | py | Python | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | null | null | null | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | 2 | 2018-04-25T22:13:34.000Z | 2018-04-26T17:52:43.000Z | tests/bak/_alignment_func.py | jumbrich/dtpattern | 38433c89d169a280b0439b9cd4f463d5d7604dd7 | [
"MIT"
] | null | null | null | from dtpattern.alignment import needle, gap_penalty, match_award, mismatch_penalty, water
def align(s1,s2):
"""
input is a list of characters or character set symbols for each s1 and s2
return is
:param s1:
:param s2:
:return: tuple of align1, align2, symbol2, identity, score
"""
i... | 27.322314 | 112 | 0.61827 | from dtpattern import alignment
from dtpattern.alignment import needle, finalize, gap_penalty, match_award, mismatch_penalty, water
from dtpattern.utils import translate
from dtpattern.alignment import alignment as al
def to_list(alpha):
if isinstance(alpha, str):
return [c for c in alpha]
def _translate... | 0 | 0 | 0 | 0 | 0 | 993 | 0 | 62 | 182 |
2899f0c4f189edbe9eb0b4a1b531ba0952b7d769 | 785 | py | Python | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | 1 | 2020-01-04T09:14:23.000Z | 2020-01-04T09:14:23.000Z | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | null | null | null | mediasort/__init__.py | aroberts/mediasort | c70836b11d19bd9fad63e22c7aa5217ae4a4cef3 | [
"BSD-3-Clause"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(levelname)s %(message)s',
"%Y-%m-%d %H:%M:%S"
)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
| 27.068966 | 70 | 0.700637 | import logging
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(levelname)s %(message)s',
"%Y-%m-%d %H:%M:%S"
)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
import mimetypes
def setup_logging(confi... | 0 | 0 | 0 | 0 | 0 | 443 | 0 | -5 | 69 |
3d45fe73ba920eaffc67a7fa644b7150bb3136b0 | 6,819 | py | Python | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | null | null | null | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | 2 | 2017-06-05T08:29:22.000Z | 2017-06-07T16:54:54.000Z | limix_ext/leap/core/calc_h2.py | glimix/limix-ext | 7cf7a3b2b02f6a73cbba90f1945a06b9295b7357 | [
"MIT"
] | null | null | null | import scipy.stats as stats
| 33.757426 | 79 | 0.525884 | import logging
import numpy as np
import scipy.stats as stats
from .eigd import eigenDecompose
def calcLiabThreholds(U, S, keepArr, phe, numRemovePCs, prev):
#Run logistic regression
G = U[:, -numRemovePCs:] * np.sqrt(S[-numRemovePCs:])
import sklearn.linear_model
Logreg = sklearn.linear_model.Logi... | 0 | 0 | 0 | 0 | 0 | 6,602 | 0 | 1 | 183 |
abb4ba64e345114c0b5be170656a0f297a42cd96 | 511 | py | Python | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | 2 | 2020-09-05T19:03:29.000Z | 2020-09-05T19:08:56.000Z | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | null | null | null | Vignette_filter.py | OhmVikrant/Vignette-Filter-using-OpenCV | 4ffe8ad956370721cea9b648765e22d6ae56cdcc | [
"MIT"
] | null | null | null | import numpy as np
import cv2
input = cv2.imread('input/strawberry.jpg')
height, width = input_image.shape[:2]
x_gauss = cv2.getGaussianKernel(width,250)
y_gauss = cv2.getGaussianKernel(height,200)
kernel = x_gauss * y_gauss.T
mask = kernel * 255 / np.linalg.norm(kernel)
ou... | 20.44 | 47 | 0.610568 | import numpy as np
import cv2
input = cv2.imread('input/strawberry.jpg')
height, width = input_image.shape[:2]
x_gauss = cv2.getGaussianKernel(width,250)
y_gauss = cv2.getGaussianKernel(height,200)
kernel = x_gauss * y_gauss.T
mask = kernel * 255 / np.linalg.norm(kernel)
ou... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b54d847ae63ed6f54873fdf4e76f651ed8a2b61d | 4,248 | py | Python | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | python-src/graphoire/digraph.py | ccorbell/graphoire | 566b0a27a9d6b87c5952bcc6e257a6d90621ca06 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 11:40:58 2021
@author: Christopher Corbell
Things we can use here:
- construct Digraph from underlying Graph (default direction for edges)
- DigraphFactory to construct some interesting digraphs
"""
| 28.702703 | 87 | 0.558851 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 11:40:58 2021
@author: Christopher Corbell
Things we can use here:
- construct Digraph from underlying Graph (default direction for edges)
- DigraphFactory to construct some interesting digraphs
"""
from graphoire.graph import Graph
cl... | 0 | 0 | 0 | 3,908 | 0 | 0 | 0 | 12 | 46 |
5db314ef9db7f8c30d914a66c1929ddcb62a2832 | 535 | py | Python | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | server/generator.py | cryptSky/hlsa_task8 | ed0d8d9d69b5e8f3bdfa5964c66ce6dcf27f07c1 | [
"MIT"
] | null | null | null | import requests
from faker import Faker
from faker.providers import date_time
import json
fake = Faker()
fake.add_provider(date_time)
for i in range(40000000):
user = {
'name': fake.name(),
'email': fake.email(),
'birthdate': fake.date()
}
response = requests.post('http://localhos... | 23.26087 | 82 | 0.6 | import requests
from faker import Faker
from faker.providers import date_time
import json
fake = Faker()
fake.add_provider(date_time)
for i in range(40000000):
user = {
'name': fake.name(),
'email': fake.email(),
'birthdate': fake.date()
}
response = requests.post('http://localhos... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6d8fbfaae089b733b5e1d89796d42c25b15b2835 | 1,212 | py | Python | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 11 | 2018-10-01T11:00:12.000Z | 2021-11-20T18:18:17.000Z | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | null | null | null | python/korean-breaks.py | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 4 | 2020-06-12T09:42:18.000Z | 2021-12-12T07:04:28.000Z | import sys
# for word segmentation and pos tagging of Korean text
# Note: You need to install "hangul-utils" in advanced
# Ref link: https://github.com/kaniblu/hangul-utils
# written by Ye Kyaw Thu, Visiting Professor, LST, NECTEC, Thailand
#
# How to run: python ./korean-breaks.py <input-filename> <word|morph|pos>
# ... | 33.666667 | 85 | 0.633663 | import sys
from hangul_utils import *
# for word segmentation and pos tagging of Korean text
# Note: You need to install "hangul-utils" in advanced
# Ref link: https://github.com/kaniblu/hangul-utils
# written by Ye Kyaw Thu, Visiting Professor, LST, NECTEC, Thailand
#
# How to run: python ./korean-breaks.py <input-fi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
8aa0dc07029827c92adf1033bab41cb860f33c8b | 127 | py | Python | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | null | null | null | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | null | null | null | DataStructure_And_Algorithm/Week5/edit_distance/edit_distance.py | sngvahmed/Algorithm-Coursera | 6b789b32ddee0bad6f754f3466cfb1a237ce6d0e | [
"Apache-2.0"
] | 1 | 2018-07-09T09:49:01.000Z | 2018-07-09T09:49:01.000Z | # Uses python3
if __name__ == "__main__":
print(edit_distance(input(), input()))
| 12.7 | 42 | 0.645669 | # Uses python3
def edit_distance(s, t):
return 0
if __name__ == "__main__":
print(edit_distance(input(), input()))
| 0 | 0 | 0 | 0 | 0 | 19 | 0 | 0 | 22 |
cb33b840af0eb1bd12c538c2fcda80451df7fc05 | 3,729 | py | Python | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | null | null | null | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | 1 | 2020-01-02T20:55:07.000Z | 2020-01-02T20:55:07.000Z | robot_teleop/nodes/auto_move_special.py | caffreyu/icra_ros_love_cannot_speak | 75719fdb2c69ac229ef22146076593af8e70905f | [
"Apache-2.0"
] | 1 | 2019-12-27T02:51:08.000Z | 2019-12-27T02:51:08.000Z | #!/usr/bin/env python
# encoding: utf-8
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist, Vector3
autoMove = AUTO_MOVE()
"""LinearPub = rospy.Publisher("/command/linear", self.twist, queue_size=5)
AngularPub = rospy.Publisher("/command/angular", self.twist, queue_size=5)"""
# pub =... | 28.25 | 92 | 0.565567 | #!/usr/bin/env python
# encoding: utf-8
import rospy
import tf
from std_msgs.msg import Float64, Int32, Int8
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist, Vector3
from PID import PID
from math import sin, cos, pi, atan2, sqrt
class AUTO_MOVE():
# all self properties
linear_vel = 0.02... | 132 | 0 | 0 | 2,808 | 0 | 0 | 0 | 31 | 111 |
9e9a250fcdb96c00671c5336a19a02e3051aab22 | 777 | py | Python | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | null | null | null | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | null | null | null | rcs_back/users_app/views.py | e-kondr01/rcs_back | f0f224d01f7051cce9d5feef692216d48cba6f31 | [
"MIT"
] | 1 | 2021-09-25T19:18:55.000Z | 2021-09-25T19:18:55.000Z | from django.contrib.auth import get_user_model
User = get_user_model()
| 28.777778 | 63 | 0.664093 | from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework.response import Response
from rest_framework.views import APIView
User = get_user_model()
class RetrieveCurrentUserView(APIView):
"""Возвращает информацию о текущем пользователе"""
def get(self, request, *arg... | 80 | 0 | 0 | 522 | 0 | 0 | 0 | 53 | 89 |
1e2e746d8cf1983c40a783689474f3881ce5bf4c | 624 | py | Python | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | SCRIPTS/radiotelescopes/plot.py | sarrvesh/academicpages.github.io | 909d8e700ed62c00d48472cf8d8564b0bf4da369 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# Create a Miller project
map = Basemap(projection='hammer', lon_0=20, resolution='l')
# Plot coastlines
map.drawcoastlines(linewidth=0.)
map.fillcontinents(alpha=0.85)
# Parse telescopes.txt and plot the points on the m... | 28.363636 | 64 | 0.690705 | #!/usr/bin/env python
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# Create a Miller project
map = Basemap(projection='hammer', lon_0=20, resolution='l')
# Plot coastlines
map.drawcoastlines(linewidth=0.)
map.fillcontinents(alpha=0.85)
# Parse telescopes.txt and plot the points on the m... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
679f5da77d443219a419e0989ed1854a3c205526 | 12,787 | py | Python | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 7 | 2019-11-07T11:33:28.000Z | 2021-04-01T07:43:15.000Z | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 1 | 2021-03-14T03:19:33.000Z | 2022-01-12T21:47:32.000Z | train_models/evaluation.py | WangStephen/DL-limited-angle-CT-reconstruction | f43c3fe806a2eee316dcbb26bddeb51c4f4a9f92 | [
"MIT"
] | 2 | 2020-04-03T05:58:16.000Z | 2021-01-06T10:24:55.000Z | """Evaluation
This script consists of evaluation functions needed
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import datetime
import tensorflow as tf
from tensorflow.python.tools import inspect_checkpoint as chkp
import load_data
from geometry_parameters import TE... | 28.929864 | 135 | 0.635098 | """Evaluation
This script consists of evaluation functions needed
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import datetime
import tensorflow as tf
from tensorflow.python.tools import inspect_checkpoint as chkp
import load_data
from geometry_parameters import TE... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4943f5346adc95d886e6def13a429e87d873fbf5 | 407 | py | Python | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | object_oriented_programming/exercise_online_shopping/main.py | jepster/python_advanced_techniques | f4b0e0dda7b66be55f650f9f902e735d3f5a9f64 | [
"MIT"
] | null | null | null | from user import User
brianna = User(1, 'Brianna')
mary = User(2, 'Mary')
keyboard = brianna.sell_product('Keyboard', 'A nice mechanical keyboard', 100)
print(keyboard.availability) # => True
mary.buy_product(keyboard)
print(keyboard.availability) # => False
review = mary.write_review('This is the best keyboard ev... | 31.307692 | 78 | 0.732187 | from user import User
brianna = User(1, 'Brianna')
mary = User(2, 'Mary')
keyboard = brianna.sell_product('Keyboard', 'A nice mechanical keyboard', 100)
print(keyboard.availability) # => True
mary.buy_product(keyboard)
print(keyboard.availability) # => False
review = mary.write_review('This is the best keyboard ev... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f955de0f4e7b4a1551cb812c5d39fa4c25a310b3 | 3,125 | py | Python | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 5 | 2016-09-12T12:52:45.000Z | 2020-03-24T14:43:13.000Z | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 435 | 2016-10-18T12:51:39.000Z | 2021-06-09T17:22:08.000Z | wins/factories.py | uktrade/export-wins-data | 46caa444812e89abe504bec8c15aa7f7ba1a247e | [
"MIT"
] | 2 | 2016-12-06T10:37:21.000Z | 2017-02-22T17:27:43.000Z | from wins.constants import WIN_TYPES
WIN_TYPES_DICT = {y: x for x, y in WIN_TYPES}
| 23.496241 | 83 | 0.71008 | import datetime
import factory
from factory.fuzzy import FuzzyChoice
from wins.models import (
Advisor,
Breakdown,
CustomerResponse,
HVC,
Notification,
Win,
)
from wins.constants import BUSINESS_POTENTIAL, SECTORS, WIN_TYPES
from users.factories import UserFactory
class WinFactory(factory.Dj... | 0 | 0 | 0 | 2,642 | 0 | 0 | 0 | 142 | 250 |
925e82a012459a533ccdda2bba698f54b3c8fa68 | 205 | py | Python | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 1 | 2016-12-04T18:01:49.000Z | 2016-12-04T18:01:49.000Z | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | 13 | 2017-03-16T15:44:21.000Z | 2019-08-19T16:56:04.000Z | flyingpigeon/tests/test_cdo.py | Zeitsperre/flyingpigeon | 678370bf428af7ffe11ee79be3b8a89c73215e5e | [
"Apache-2.0"
] | null | null | null |
from cdo import Cdo
cdo = Cdo()
| 17.083333 | 65 | 0.77561 | import pytest
from .common import TESTDATA
from flyingpigeon.utils import local_path
from cdo import Cdo
cdo = Cdo()
def test_sinfo():
cdo.sinfo(input=local_path(TESTDATA['cmip5_tasmax_2006_nc']))
| 0 | 0 | 0 | 0 | 0 | 62 | 0 | 19 | 90 |
481cea70c60a9294257dfd00b7d7c5217cf84b4b | 4,758 | py | Python | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | tests/test_TransactionBook.py | LukHad/AccountBook | 8da3ebbd2a824efb9d50f7695ceaaa6cf2370cd8 | [
"MIT"
] | null | null | null | import os
import nose
def save_load(tb):
"""
Helper function wich does save and load the data.
:param tb: Transaction Book
:return tb2: Transaction Book after save load operation
"""
filename = "dummy_database.csv"
tb.save_as(filename)
tb2 = TransactionBook()
tb2.load_from(filena... | 34.729927 | 100 | 0.678857 | from datetime import datetime
import os
import nose
import nose.tools
from TransactionBook.model.TransactionBook import *
def dummy_transactions():
tb = TransactionBook()
tb.new_transaction("01.07.2017", "Account 1", "My first transaction", 1000, "Income")
tb.new_transaction("11.08.2017", "Account 1", "Ci... | 0 | 0 | 0 | 0 | 0 | 3,765 | 0 | 34 | 319 |
205f841d52dcdd4a86affc009e851addf2fcf525 | 1,814 | py | Python | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | 141 Linked List Cycle.py | scorpionpd/LeetCode-all | 0d65494f37d093d650b83b93409e874c041f3abe | [
"MIT"
] | null | null | null | """
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
"""
__author__ = 'Danyang'
# Definition for singly-linked list.
| 36.28 | 76 | 0.312018 | """
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
"""
__author__ = 'Danyang'
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def hasCycle(self, head):
... | 0 | 0 | 0 | 1,589 | 0 | 0 | 0 | 0 | 45 |
20647d88459b1d700e8e2bbf54730b3fedf4e894 | 5,226 | py | Python | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/record_rule_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
| 27.797872 | 104 | 0.590126 | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class RecordRuleReq:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is a... | 222 | 1,904 | 0 | 3,108 | 0 | 0 | 0 | 30 | 91 |
74458867b1ca3d7d9fb26951a2f67859b9b082c0 | 542 | py | Python | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 6 | 2020-09-03T13:10:49.000Z | 2021-03-10T01:13:49.000Z | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | 11 | 2020-05-22T09:43:29.000Z | 2021-03-24T10:55:49.000Z | contest/impls/render_markdown.py | nya3jp/rules_contest | e74a9892785912b11bbd975068641e558aa4a623 | [
"MIT"
] | null | null | null |
_EXTENSIONS = (
'markdown.extensions.fenced_code',
'markdown.extensions.tables',
)
if __name__ == '__main__':
main()
| 19.357143 | 58 | 0.656827 | import argparse
import markdown
_EXTENSIONS = (
'markdown.extensions.fenced_code',
'markdown.extensions.tables',
)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--output', required=True)
parser.add_argument('--input', required=True)
options = parser.parse_args()
wi... | 0 | 0 | 0 | 0 | 0 | 353 | 0 | -12 | 68 |
c26d1e2e9e627e7d37923e241ab3efd749499c2a | 2,813 | py | Python | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | html_parser.py | WuTao1530663/web_spider_in_python | 1a3ba3471942bc5e38b1d5cac37568341ff0dd6f | [
"Apache-2.0"
] | null | null | null | import requests
if __name__ == '__main__':
info = u"""<div id="info" class="">\
<span>\
<span class="pl"> </span>\
<a class="" href="/search/%E5%8D%A1%E5%8B%92%E5%BE%B7%C2%B7%E8%83%A1%E8%B5%9B%E5%B0%BC">[] </a>\
</span><br>\
<span class="pl">:</span> <br>\
<span class="pl">:</span> The K... | 43.276923 | 131 | 0.603271 | from bs4 import BeautifulSoup
import re
import urllib.parse
import requests
class HtmlParser(object):
def parse(self,url, html_content):
book_data = {}
soup = BeautifulSoup(html_content, 'html.parser',from_encoding='utf-8')
book_data['书籍ID'] = url[-8:-1]
book_data['书名'] = soup.find(... | 289 | 0 | 0 | 1,696 | 0 | 0 | 0 | -6 | 88 |
0443796cd2d92bcfaddb64cdd45f4bd50ae576c8 | 4,012 | py | Python | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | 1 | 2020-10-17T17:23:58.000Z | 2020-10-17T17:23:58.000Z | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | null | null | null | pybycus/authtab.py | lutetiensis/pybycus | 20ed6f2d7aeeee397bc27593fe085d981a1cc2a0 | [
"BSD-3-Clause"
] | null | null | null | """ AUTHTAB.DIR file parser. """
def content(path):
""" Return the content of an AUTHTAB.DIR file. """
return AuthTab(path).content()
if __name__ == "__main__":
import sys
import pprint
pprint.pprint(content(sys.argv[1]))
| 47.761905 | 80 | 0.55683 | """ AUTHTAB.DIR file parser. """
from pybycus.file import File
class AuthTab(File):
""" The Author List (with the filename AUTHTAB.DIR) contains
descriptive information for each text file on the disc. The
purpose of the Author Table is to allow the user to ask for
the author Plato, for example, withou... | 0 | 0 | 0 | 3,714 | 0 | 0 | 0 | 8 | 46 |
320e0a142f301f2fe27e02d1482f04be409d2b92 | 2,980 | py | Python | tests/data_collection_tests/test_observational_data_collector.py | CITCOM-project/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | 1 | 2021-12-15T14:54:32.000Z | 2021-12-15T14:54:32.000Z | tests/data_collection_tests/test_observational_data_collector.py | AndrewC19/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | 42 | 2021-11-25T11:11:07.000Z | 2022-03-21T09:47:02.000Z | tests/data_collection_tests/test_observational_data_collector.py | AndrewC19/CausalTestingFramework | ca83012dbaf7b1f95c118939570fc8b2c49bca68 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 48.852459 | 110 | 0.696309 | import unittest
import os
import pandas as pd
from causal_testing.data_collection.data_collector import ObservationalDataCollector
from causal_testing.specification.causal_specification import Scenario
from causal_testing.specification.variable import Input, Output, Meta
from scipy.stats import uniform, rv_discrete
fro... | 0 | 0 | 0 | 2,498 | 0 | 0 | 0 | 239 | 177 |
9f86c14a0806b55f9050c006457010a10a435371 | 1,262 | py | Python | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null | data formatting/format.py | ManindraDeMel/Deep-Deblurring | 0332591d3aaa3940542f34b6603fd3dd154416bf | [
"MIT"
] | null | null | null |
# This library only words with the assumption that the dataset has been formatted as 0.jpg, 1.jpg ... or 0.png, 1.png ... accordingly | 45.071429 | 171 | 0.681458 | from PIL import Image, ImageFilter
import random
# This library only words with the assumption that the dataset has been formatted as 0.jpg, 1.jpg ... or 0.png, 1.png ... accordingly
def blurImage(path, blur_num):
if (random.randint(0, 2) > 1): # Using different blurs randomly, if you only have a dataset with s... | 0 | 0 | 0 | 0 | 0 | 986 | 0 | 5 | 136 |