hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c77727d2ca5c83085d1d114016352896a3a7e5aa | 1,226 | py | Python | igvc_ws/src/igvc_nav/src/path_planner/open_list.py | SoonerRobotics/igvc_software_2020 | 05509c2f68b6c5a96f325a18ca86c3a0c00e86e5 | [
"MIT"
] | 3 | 2019-07-14T20:20:53.000Z | 2020-05-07T03:41:25.000Z | igvc_ws/src/igvc_nav/src/path_planner/open_list.py | SoonerRobotics/igvc_software_2020 | 05509c2f68b6c5a96f325a18ca86c3a0c00e86e5 | [
"MIT"
] | 13 | 2019-11-12T02:57:54.000Z | 2020-03-17T17:04:22.000Z | igvc_ws/src/igvc_nav/src/path_planner/open_list.py | SoonerRobotics/igvc_software_2020 | 05509c2f68b6c5a96f325a18ca86c3a0c00e86e5 | [
"MIT"
] | 2 | 2020-02-26T01:12:27.000Z | 2020-02-26T19:01:53.000Z | import heapq
from node import Node
class OpenList:
def __init__(self):
""" Initialize the open list """
# Set up an empty min heap using list and heapq
self.min_heap = []
heapq.heapify(self.min_heap)
def update(self, node):
""" Update a node entry in the open list """
if node in self.min_heap:
self.delete(node)
self.insert(node)
def insert(self, node):
""" Add a node to the queue """
# Push the node to the heap
heapq.heappush(self.min_heap, node)
def delete(self, node):
""" Delete a node from the open list """
if node in self.min_heap:
self.min_heap.remove(node)
heapq.heapify(self.min_heap)
def top_key(self):
""" Get the top value in the heap """
if len(self.min_heap) == 0:
return (Node.INFINITY, Node.INFINITY)
# The top key will be the lowest priority
return min(self.min_heap).key
def top(self):
""" Get the top value from the list """
if len(self.min_heap) == 0:
return None
return self.min_heap[0]
def contains(self, val):
return val in self.min_heap
| 27.244444 | 55 | 0.571778 | 175 | 1,226 | 3.908571 | 0.285714 | 0.133041 | 0.192982 | 0.057018 | 0.295322 | 0.24269 | 0.166667 | 0.099415 | 0.099415 | 0.099415 | 0 | 0.00365 | 0.329527 | 1,226 | 44 | 56 | 27.863636 | 0.828467 | 0.243883 | 0 | 0.230769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0 | 0.076923 | 0.038462 | 0.576923 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c783ab08451f7b76fe4ca60a588bd0352bef5e96 | 132 | py | Python | repoassist/__main__.py | DamianPala/sicloudman | c86728467e08f712dbc72116d1db4689d713abd5 | [
"MIT"
] | null | null | null | repoassist/__main__.py | DamianPala/sicloudman | c86728467e08f712dbc72116d1db4689d713abd5 | [
"MIT"
] | null | null | null | repoassist/__main__.py | DamianPala/sicloudman | c86728467e08f712dbc72116d1db4689d713abd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from .cli import main
if __name__ == '__main__':
sys.exit(main())
| 11 | 26 | 0.606061 | 19 | 132 | 3.789474 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009524 | 0.204545 | 132 | 11 | 27 | 12 | 0.67619 | 0.318182 | 0 | 0 | 0 | 0 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c78c22712edefb26f177a12bc84bbb4633ba651e | 312 | py | Python | colibris/commands/runworker.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 6 | 2019-06-22T19:36:10.000Z | 2021-11-16T08:07:21.000Z | colibris/commands/runworker.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 34 | 2019-07-07T18:01:41.000Z | 2020-11-01T16:14:58.000Z | colibris/commands/runworker.py | AMecea/colibris | 068b7cbc4ed328dd9f3b4c40c5227b026589b028 | [
"BSD-3-Clause"
] | 2 | 2020-09-01T13:07:17.000Z | 2021-07-29T12:16:29.000Z |
import logging
from colibris import taskqueue
from .base import BaseCommand
logger = logging.getLogger(__name__)
class RunWorkerCommand(BaseCommand):
def add_arguments(self, parser):
taskqueue.add_worker_arguments(parser)
def execute(self, options):
taskqueue.run_worker(options)
| 17.333333 | 46 | 0.753205 | 35 | 312 | 6.485714 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176282 | 312 | 17 | 47 | 18.352941 | 0.883268 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
c79235f0ce325709ab489775fdb275b942b63ef1 | 1,600 | py | Python | Anemone/__init__.py | Winnak/Anemone | 1ae72bf2500c262e3cdd57f697a5c8bc38e851e3 | [
"MIT"
] | 5 | 2016-04-24T21:10:28.000Z | 2021-09-29T20:26:14.000Z | Anemone/__init__.py | Winnak/Anemone | 1ae72bf2500c262e3cdd57f697a5c8bc38e851e3 | [
"MIT"
] | null | null | null | Anemone/__init__.py | Winnak/Anemone | 1ae72bf2500c262e3cdd57f697a5c8bc38e851e3 | [
"MIT"
] | null | null | null | """ The main import stuff script """
# pylint: disable=C0103
# disabling C0103: Invalid constant name "app", to be consistent with flask apps.
import os
from flask import Flask
from apscheduler.schedulers.background import BackgroundScheduler
app = Flask(__name__)
app.config.from_pyfile("../application.cfg", False)
schedule = BackgroundScheduler()
schedule.start() #TODO: restart unfinshed jobs
# TODO: find a better place for this
@app.context_processor
def utility_processor():
""" custom funcions for jinja """
def get_status_icon(statuscode):
""" returns the proper icon for the status code """
def status_switch(x):
""" switch case for status codes """
return {
0 : "fa fa-circle",
1 : "fa fa-check-circle",
2 : "fa fa-exclamation-circle",
3 : "fa fa-times-circle",
4 : "fa fa-cog fa-spin",
5 : "fa fa-clock-o"
}.get(x, 0)
return status_switch(statuscode)
return dict(get_status_icon=get_status_icon)
# pylint: disable=C0413
# Import should be placed at the top of the module
# pylint has been disabled here because of how flask recommends maintaining a project
import Anemone.views.projects
import Anemone.views.dashboard
import Anemone.views.jobs
import Anemone.views.login
import Anemone.views.configuration
import Anemone.views.namegen
import Anemone.views.health
from Anemone.models import ProjectJSONEncoder
app.json_encoder = ProjectJSONEncoder
from Anemone.githandling import setup_schedule
setup_schedule()
| 30.769231 | 85 | 0.695 | 206 | 1,600 | 5.31068 | 0.519417 | 0.083181 | 0.115174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015176 | 0.2175 | 1,600 | 51 | 86 | 31.372549 | 0.858626 | 0.2825 | 0 | 0 | 0 | 0 | 0.107431 | 0.0188 | 0 | 0 | 0 | 0.019608 | 0 | 1 | 0.09375 | false | 0 | 0.375 | 0 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
c7bbc6df969481e0cffeb7834bd31f45f59d17cd | 1,139 | py | Python | TrackPropagation/SteppingHelixPropagator/python/SteppingHelixPropagatorHLT_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | TrackPropagation/SteppingHelixPropagator/python/SteppingHelixPropagatorHLT_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | TrackPropagation/SteppingHelixPropagator/python/SteppingHelixPropagatorHLT_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAny_cfi
SteppingHelixPropagatorL2Any = TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAny_cfi.SteppingHelixPropagatorAny.clone()
import TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi
SteppingHelixPropagatorL2Along = TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi.SteppingHelixPropagatorAlong.clone()
import TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi
SteppingHelixPropagatorL2Opposite = TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi.SteppingHelixPropagatorOpposite.clone()
SteppingHelixPropagatorL2Any.ComponentName = 'SteppingHelixPropagatorL2Any'
SteppingHelixPropagatorL2Any.useTuningForL2Speed = True
SteppingHelixPropagatorL2Along.ComponentName = 'SteppingHelixPropagatorL2Along'
SteppingHelixPropagatorL2Along.useTuningForL2Speed = True
SteppingHelixPropagatorL2Opposite.ComponentName = 'SteppingHelixPropagatorL2Opposite'
SteppingHelixPropagatorL2Opposite.useTuningForL2Speed = True
| 71.1875 | 152 | 0.924495 | 60 | 1,139 | 17.45 | 0.316667 | 0.223496 | 0.12894 | 0.129895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013636 | 0.034241 | 1,139 | 15 | 153 | 75.933333 | 0.938182 | 0 | 0 | 0 | 0 | 0 | 0.079965 | 0.079965 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.307692 | 0 | 0.307692 | 0 | 0 | 0 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c7bf1cafbc2455a041ae7e51958886c2c9a572e5 | 8,977 | py | Python | mime_types/__init__.py | nuxeo-cps/pre-svn-reorg--PortalTransforms | 75e9a0c469ee4d967e2ad360b4f2ecd73136da46 | [
"BSD-3-Clause"
] | null | null | null | mime_types/__init__.py | nuxeo-cps/pre-svn-reorg--PortalTransforms | 75e9a0c469ee4d967e2ad360b4f2ecd73136da46 | [
"BSD-3-Clause"
] | null | null | null | mime_types/__init__.py | nuxeo-cps/pre-svn-reorg--PortalTransforms | 75e9a0c469ee4d967e2ad360b4f2ecd73136da46 | [
"BSD-3-Clause"
] | null | null | null | # $Id$
from Products.PortalTransforms.interfaces import iclassifier
from Products.PortalTransforms.MimeTypeItem import MimeTypeItem, \
MimeTypeException
from types import InstanceType
import re
class text_plain(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "Plain Text"
mimetypes = ('text/plain',)
extensions = ('txt',)
binary = 0
class text_structured(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "Structured Text"
mimetypes = ('text/structured',)
extensions = ('stx',)
binary = 0
class text_rest(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "reST"
mimetypes = ("text/x-rst", "text/restructured",)
extensions = ("rst", "rest", "restx") #txt?
binary = 0
class text_python(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "python"
mimetypes = ("text/python-source", "text/x-python",)
extensions = ("py",)
binary = 0
class application_rtf(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = 'rtf'
mimetypes = ('application/rtf',)
extensions = ('rtf',)
binary = 1
class application_msword(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "Microsoft Word Document"
mimetypes = ('application/msword',)
extensions = ('doc',)
binary = 1
class application_msexcel(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "Microsoft Excel Document"
mimetypes = ('application/vnd.ms-excel',)
extensions = ('xls',)
binary = 1
class application_mspowerpoint(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "Microsoft PowerPoint Document"
mimetypes = ('application/vnd.ms-powerpoint',)
extensions = ('ppt',)
binary = 1
class application_docbook(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "DocBook XML Document"
mimetypes = ('application/docbook+xml',)
extensions = ('doc.xml', 'docb.xml', 'docb',)
binary = 0
class application_writer(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Writer Document"
mimetypes = ('application/vnd.sun.xml.writer',)
extensions = ('sxw',)
binary = 1
class application_writer_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Writer Template"
mimetypes = ('application/vnd.sun.xml.writer.template',)
extensions = ('stw',)
binary = 1
class application_impress(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Impress Document"
mimetypes = ('application/vnd.sun.xml.impress',)
extensions = ('sxi',)
binary = 1
class application_impress_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Impress Template"
mimetypes = ('application/vnd.sun.xml.impress.template',)
extensions = ('sti',)
binary = 1
class application_calc(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Calc Document"
mimetypes = ('application/vnd.sun.xml.calc',)
extensions = ('sxc',)
binary = 1
class application_calc_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Calc Template"
mimetypes = ('application/vnd.sun.xml.calc.template',)
extensions = ('stc',)
binary = 1
class application_draw(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Draw Document"
mimetypes = ('application/vnd.sun.xml.draw',)
extensions = ('sxd',)
binary = 1
class application_draw_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 1.x Draw Template"
mimetypes = ('application/vnd.sun.xml.draw.template',)
extensions = ('std',)
binary = 1
class application_opendocument_calc(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Calc Document"
mimetypes = ('application/vnd.oasis.opendocument.spreadsheet',)
extensions = ('ods',)
binary = 1
class application_opendocument_calc_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Calc Template"
mimetypes = ('application/vnd.oasis.opendocument.spreadsheet-template',)
extensions = ('ots',)
binary = 1
class application_opendocument_writer(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Writer Document"
mimetypes = ('application/vnd.oasis.opendocument.text',)
extensions = ('odt',)
binary = 1
class application_opendocument_writer_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Writer Template"
mimetypes = ('application/vnd.oasis.opendocument.text-template',)
extensions = ('ott',)
binary = 1
class application_opendocument_impress(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Impress Document"
mimetypes = ('application/vnd.oasis.opendocument.presentation',)
extensions = ('odp',)
binary = 1
class application_opendocument_impress_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Impress Template"
mimetypes = ('application/vnd.oasis.opendocument.presentation-template',)
extensions = ('otp',)
binary = 1
class application_opendocument_graphics(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Draw Document"
mimetypes = ('application/vnd.oasis.opendocument.graphics',)
extensions = ('odg',)
binary = 1
class application_opendocument_graphics_template(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "OpenOffice.org 2.x Draw Template"
mimetypes = ('application/vnd.oasis.opendocument.graphics-template',)
extensions = ('otg',)
binary = 1
class text_xml(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__ + (iclassifier,)
__name__ = "Extensible Markup Language"
mimetypes = ('text/xml',)
extensions = ('xml',)
binary = 0
def classify(self, data):
m = re.search('<?xml.*?>', data)
if m:
return 1 # True
return None # False
class application_octet_stream(MimeTypeItem):
"""we need to be sure this one exists"""
__name__ = "Octet Stream"
mimetypes = ('application/octet-stream',)
binary = 1
extensions = ()
class application_x_gtar(MimeTypeItem):
__implements__ = MimeTypeItem.__implements__
__name__ = "application/x-gtar"
mimetypes = ('application/x-gtar',)
binary = 1
extensions = ('tar.gz', 'tgz', )
# TODO: this list should be automagically computed using introspection.
reg_types = [
text_plain,
application_msword,
application_msexcel,
application_mspowerpoint,
application_docbook,
application_writer,
application_writer_template,
application_impress,
application_impress_template,
application_calc,
application_calc_template,
application_draw,
application_draw_template,
application_opendocument_writer,
application_opendocument_writer_template,
application_opendocument_impress,
application_opendocument_impress_template,
application_opendocument_calc,
application_opendocument_calc_template,
application_opendocument_graphics,
application_opendocument_graphics_template,
text_xml,
text_structured,
text_rest,
text_python,
application_octet_stream,
application_rtf,
application_x_gtar,
]
import mimetypes as pymimetypes
def initialize(registry):
for mt in reg_types:
if type(mt) != InstanceType:
mt = mt()
registry.register(mt)
#Find things that are not in the specially registered mimetypes
#and add them using some default policy, none of these will impl
#iclassifier
for ext, mt in pymimetypes.types_map.items():
if ext[0] == '.':
ext = ext[1:]
try:
mto = registry.lookup(mt)
except MimeTypeException:
# malformed MIME type
continue
if mto:
mto = mto[0]
if not ext in mto.extensions:
registry.register_extension(ext, mto)
mto.extensions += (ext, )
continue
isBin = mt.split('/', 1)[0] != "text"
registry.register(MimeTypeItem(mt, (mt,), (ext,), isBin))
| 32.291367 | 78 | 0.687758 | 869 | 8,977 | 6.616801 | 0.180667 | 0.206609 | 0.159652 | 0.206609 | 0.533739 | 0.431826 | 0.21287 | 0.21287 | 0.206957 | 0.201043 | 0 | 0.007069 | 0.212098 | 8,977 | 277 | 79 | 32.407942 | 0.805882 | 0.031302 | 0 | 0.245614 | 0 | 0 | 0.201106 | 0.087077 | 0 | 0 | 0 | 0.00361 | 0 | 1 | 0.008772 | false | 0 | 0.02193 | 0 | 0.77193 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c7d9b5c1298d974acb6a23c5f8a4c88b24b93ea9 | 140 | py | Python | exercicios/desafio 61.py | ibianco91/curso_em_video | 13829b5d2e2290fcffe47ef0ab902b5e4a24a0ed | [
"MIT"
] | null | null | null | exercicios/desafio 61.py | ibianco91/curso_em_video | 13829b5d2e2290fcffe47ef0ab902b5e4a24a0ed | [
"MIT"
] | null | null | null | exercicios/desafio 61.py | ibianco91/curso_em_video | 13829b5d2e2290fcffe47ef0ab902b5e4a24a0ed | [
"MIT"
] | null | null | null | a = int(input('Digite o primeiro termo: '))
r = int(input('Digite a razão: '))
c = 1
while c <= 10:
a +=r
c +=1
print(a-r)
| 10.769231 | 43 | 0.507143 | 25 | 140 | 2.84 | 0.56 | 0.225352 | 0.394366 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040816 | 0.3 | 140 | 12 | 44 | 11.666667 | 0.683673 | 0 | 0 | 0 | 0 | 0 | 0.303704 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c7e8d253556b5209eced317dd3d88d8d3237d6c5 | 2,332 | py | Python | aiotdlib/api/types/notification_group_type.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/types/notification_group_type.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/types/notification_group_type.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# #
# =============================================================================== #
from __future__ import annotations
from pydantic import Field
from ..base_object import BaseObject
class NotificationGroupType(BaseObject):
"""
Describes the type of notifications in a notification group
"""
ID: str = Field("notificationGroupType", alias="@type")
class NotificationGroupTypeCalls(NotificationGroupType):
"""
A group containing notifications of type notificationTypeNewCall
"""
ID: str = Field("notificationGroupTypeCalls", alias="@type")
@staticmethod
def read(q: dict) -> NotificationGroupTypeCalls:
return NotificationGroupTypeCalls.construct(**q)
class NotificationGroupTypeMentions(NotificationGroupType):
"""
A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
"""
ID: str = Field("notificationGroupTypeMentions", alias="@type")
@staticmethod
def read(q: dict) -> NotificationGroupTypeMentions:
return NotificationGroupTypeMentions.construct(**q)
class NotificationGroupTypeMessages(NotificationGroupType):
"""
A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
"""
ID: str = Field("notificationGroupTypeMessages", alias="@type")
@staticmethod
def read(q: dict) -> NotificationGroupTypeMessages:
return NotificationGroupTypeMessages.construct(**q)
class NotificationGroupTypeSecretChat(NotificationGroupType):
"""
A group containing a notification of type notificationTypeNewSecretChat
"""
ID: str = Field("notificationGroupTypeSecretChat", alias="@type")
@staticmethod
def read(q: dict) -> NotificationGroupTypeSecretChat:
return NotificationGroupTypeSecretChat.construct(**q)
| 32.388889 | 195 | 0.634648 | 170 | 2,332 | 8.676471 | 0.370588 | 0.016949 | 0.033898 | 0.100339 | 0.288814 | 0.288814 | 0.288814 | 0.161356 | 0.161356 | 0.161356 | 0 | 0 | 0.226844 | 2,332 | 71 | 196 | 32.84507 | 0.818081 | 0.397084 | 0 | 0.16 | 1 | 0 | 0.124324 | 0.105019 | 0 | 0 | 0 | 0 | 0 | 1 | 0.16 | false | 0 | 0.12 | 0.16 | 0.84 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1be04ef626ecbce08f7d11a2edb1c0571d5ddd52 | 551 | py | Python | test/unit/object/test_api_json_object.py | jayneeljariwala/box-python-sdk | 39aa284c776817453e4a75533a7e0b5516c03752 | [
"Apache-2.0"
] | 367 | 2015-02-10T05:55:45.000Z | 2022-03-16T23:39:58.000Z | test/unit/object/test_api_json_object.py | jayneeljariwala/box-python-sdk | 39aa284c776817453e4a75533a7e0b5516c03752 | [
"Apache-2.0"
] | 686 | 2015-02-10T01:21:28.000Z | 2022-03-31T11:40:22.000Z | test/unit/object/test_api_json_object.py | jayneeljariwala/box-python-sdk | 39aa284c776817453e4a75533a7e0b5516c03752 | [
"Apache-2.0"
] | 260 | 2015-02-16T17:35:06.000Z | 2022-03-20T17:45:28.000Z | # coding: utf-8
from __future__ import unicode_literals, absolute_import
import pytest
from boxsdk.object.api_json_object import APIJSONObject
@pytest.fixture(params=[{'foo': 'bar'}, {'a': {'b': 'c'}}])
def api_json_object(request):
return request.param, APIJSONObject(request.param)
def test_len(api_json_object):
dictionary, test_object = api_json_object
assert len(dictionary) == len(test_object)
def test_api_json_object_dict(api_json_object):
dictionary, test_object = api_json_object
assert dictionary == test_object
| 25.045455 | 59 | 0.76225 | 76 | 551 | 5.171053 | 0.407895 | 0.124682 | 0.231552 | 0.145038 | 0.264631 | 0.264631 | 0.264631 | 0.264631 | 0.264631 | 0.264631 | 0 | 0.002088 | 0.130672 | 551 | 21 | 60 | 26.238095 | 0.818372 | 0.023593 | 0 | 0.166667 | 0 | 0 | 0.016791 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.25 | false | 0 | 0.25 | 0.083333 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
1bf024bbfa823ab08e6718375dc4815b2cbcbe63 | 761 | py | Python | poradnia/users/login_form.py | efefre/poradnia | 8bf9c88888d538cf4d1224431355c850d31ef252 | [
"MIT"
] | 23 | 2015-07-20T01:10:52.000Z | 2021-01-12T10:05:48.000Z | poradnia/users/login_form.py | efefre/poradnia | 8bf9c88888d538cf4d1224431355c850d31ef252 | [
"MIT"
] | 710 | 2015-07-12T13:19:14.000Z | 2022-03-29T12:38:18.000Z | poradnia/users/login_form.py | efefre/poradnia | 8bf9c88888d538cf4d1224431355c850d31ef252 | [
"MIT"
] | 20 | 2015-07-21T00:45:34.000Z | 2021-01-31T12:48:18.000Z | from allauth.account.forms import LoginForm
from atom.ext.crispy_forms.forms import SingleButtonMixin
from crispy_forms.bootstrap import PrependedText
from crispy_forms.layout import Layout
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _l
class CustomLoginForm(SingleButtonMixin, LoginForm):
action_text = _l("Sign In")
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["login"].label = _("Login")
self.helper.form_class = "login-form"
self.helper.layout = Layout(
PrependedText("login", '<i class="fa fa-user"></i>'),
PrependedText("password", '<i class="fa fa-key"></i>', type="password"),
)
| 38.05 | 84 | 0.695138 | 93 | 761 | 5.494624 | 0.462366 | 0.064579 | 0.058708 | 0.101761 | 0.156556 | 0.156556 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177398 | 761 | 19 | 85 | 40.052632 | 0.816294 | 0 | 0 | 0 | 0 | 0 | 0.130092 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0.0625 | 0.375 | 0 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
1bfc5a7ad3c2513eb7cd774542fb8ddc45810c8a | 856 | py | Python | Handler/DataHandler.py | SuiMingYang/ECKG | e394b1a57bb147b2742d9dcc77d05042bad793a5 | [
"MIT"
] | 16 | 2020-04-25T03:38:24.000Z | 2021-11-17T15:25:33.000Z | Handler/DataHandler.py | SuiMingYang/ECKG | e394b1a57bb147b2742d9dcc77d05042bad793a5 | [
"MIT"
] | 1 | 2020-03-14T14:40:11.000Z | 2020-03-14T14:40:11.000Z | Handler/DataHandler.py | SuiMingYang/ECKG | e394b1a57bb147b2742d9dcc77d05042bad793a5 | [
"MIT"
] | 9 | 2020-04-20T08:19:46.000Z | 2022-01-24T04:09:35.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : DataHandler.py
@Time : 2019/11/20 16:51:18
@Author : sui mingyang
@Version : 0.0.1
@Contact : suimingyang123@gmail.com
@License : (C)Copyright 2018-2019, weidian
@Desc : None
'''
from Helper.DataHelper import DataHelper
from Config.base import conf,variable
# 数据处理
class DataHandler(object):
def __init__(self,host,username,password):
#host=conf.get('neo4j','server'),username=conf.get('neo4j','user'),password=conf.get('neo4j','pwd')
self.helper=DataHelper(host=host,username=username,password=password)
def update_by_day(self):
pass
def update_intime(self):
pass
def co_recommend_by_product(self):
pass
def co_recommend_by_user(self):
pass
def recommend_by_graph(self,top):
pass
| 24.457143 | 107 | 0.655374 | 113 | 856 | 4.831858 | 0.584071 | 0.058608 | 0.080586 | 0.047619 | 0.087912 | 0.087912 | 0 | 0 | 0 | 0 | 0 | 0.047337 | 0.21028 | 856 | 34 | 108 | 25.176471 | 0.760355 | 0.41472 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0.466667 | 0.133333 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
4003eafcb85019f299f6d0f3d3e14239c9f2ef8e | 689 | py | Python | test/controls/conditions/test_when.py | ownport/playbook | 6d3196ddf68f2c3c3efc4a52e26719c3e5596dca | [
"MIT"
] | 1 | 2018-09-10T10:01:25.000Z | 2018-09-10T10:01:25.000Z | test/controls/conditions/test_when.py | ownport/playbook | 6d3196ddf68f2c3c3efc4a52e26719c3e5596dca | [
"MIT"
] | null | null | null | test/controls/conditions/test_when.py | ownport/playbook | 6d3196ddf68f2c3c3efc4a52e26719c3e5596dca | [
"MIT"
] | null | null | null | from playbook.controls.conditions.case_when import Action
def test_actions_conditions_when():
cond_when = Action(*['10 == 10'])
assert isinstance(cond_when, Action)
def test_actions_conditions_when_run():
assert Action(*['True']).run().get(u'action') == 'when'
assert Action(*['False']).run().get(u'status') == 'FAILED'
assert Action().run().get(u'status') == 'SUCCESS'
assert Action(*['10 == 10']).run().get(u'status') == 'SUCCESS'
assert Action(*['3 > 2', '2 > 1', '1 > 0']).run().get(u'status') == 'SUCCESS'
assert Action(*['True', 'False']).run().get(u'status') == 'FAILED'
assert Action(*['2 > 1', '1 > 2']).run().get(u'status') == 'FAILED'
| 34.45 | 81 | 0.605225 | 94 | 689 | 4.329787 | 0.287234 | 0.206388 | 0.120393 | 0.191646 | 0.626536 | 0.579853 | 0.412776 | 0.176904 | 0 | 0 | 0 | 0.030717 | 0.149492 | 689 | 19 | 82 | 36.263158 | 0.663823 | 0 | 0 | 0 | 0 | 0 | 0.208999 | 0 | 0 | 0 | 0 | 0 | 0.666667 | 1 | 0.166667 | false | 0 | 0.083333 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40078a763997ff6cc494585d121898c33823e0fe | 160 | py | Python | setup_writer/__init__.py | Gowthaman1401/Setup-Writer | 62810c9978b1a6a413e40b443323295511f124f7 | [
"Apache-2.0"
] | null | null | null | setup_writer/__init__.py | Gowthaman1401/Setup-Writer | 62810c9978b1a6a413e40b443323295511f124f7 | [
"Apache-2.0"
] | null | null | null | setup_writer/__init__.py | Gowthaman1401/Setup-Writer | 62810c9978b1a6a413e40b443323295511f124f7 | [
"Apache-2.0"
] | null | null | null | '''To help in writng setup.py and upload package to pip'''
__version__ = '1.0.0'
__author__ = 'Gowthaman'
from .Setup import Classifiers, Setup, upload
| 22.857143 | 59 | 0.7 | 23 | 160 | 4.521739 | 0.782609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023077 | 0.1875 | 160 | 6 | 60 | 26.666667 | 0.776923 | 0.325 | 0 | 0 | 0 | 0 | 0.145833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
400c14ec8748aa534a819e4f142b44964d2ce90d | 2,832 | py | Python | stac_fastapi/sqlalchemy/tests/features/test_custom_models.py | AsgerPetersen/stac-fastapi | 27e134589107654920c2f1dba54773c8c85d4e1a | [
"MIT"
] | 64 | 2021-03-27T19:34:29.000Z | 2022-03-31T07:58:58.000Z | stac_fastapi/sqlalchemy/tests/features/test_custom_models.py | nmandery/stac-fastapi | 8cce4fb449d6bdb36a788e959bce6012cd6f83e6 | [
"MIT"
] | 218 | 2021-03-27T19:51:54.000Z | 2022-03-28T12:41:56.000Z | src/stac_fastapi/sqlalchemy/tests/features/test_custom_models.py | Dataforsyningen/skraafoto_stac_public | fa9cb7e3516cfacf730d24bb56ae50e2e0e5bae1 | [
"MIT"
] | 44 | 2021-04-05T12:06:25.000Z | 2022-03-01T12:06:29.000Z | # from typing import Type
#
# import sqlalchemy as sa
# from starlette.testclient import TestClient
#
# # TODO: move these
# from stac_api.models.database import Item
# from stac_api.models.schemas import Collection
#
# from stac_fastapi.api.app import StacApi
# from stac_fastapi.extensions.core import TransactionExtension
# from stac_fastapi.postgres.core import CoreCrudClient, Session
# from stac_fastapi.postgres.transactions import TransactionsClient
# from stac_fastapi.postgres.config import PostgresSettings
#
#
# from ..conftest import MockStarletteRequest
#
#
# class CustomItem(Item):
# foo = sa.Column(sa.VARCHAR(10))
#
#
# def create_app(item_model: Type[Item], db_session: Session) -> StacApi:
# """Create application with a custom sqlalchemy item"""
# api = StacApi(
# settings=PostgresSettings(indexed_fields={"datetime", "foo"}),
# extensions=[
# TransactionExtension(
# client=TransactionsClient(item_table=item_model, session=db_session)
# )
# ],
# client=CoreCrudClient(item_table=item_model, session=db_session),
# )
# return api
#
#
# def test_custom_item(load_test_data, postgres_transactions, db_session):
# api = create_app(CustomItem, db_session)
# transactions = TransactionsClient(item_table=CustomItem, session=db_session)
#
# with TestClient(api.app) as test_client:
# # Ingest a collection
# coll = Collection.parse_obj(load_test_data("test_collection.json"))
# transactions.create_collection(coll, request=MockStarletteRequest)
#
# # Modify the table to match our custom item
# # This would typically be done with alembic
# db_session.writer.cached_engine.execute(
# "ALTER TABLE data.items ADD COLUMN foo VARCHAR(10)"
# )
#
# # Post an item
# test_item = load_test_data("test_item.json")
# test_item["properties"]["foo"] = "hello"
# resp = test_client.post(
# f"/collections/{test_item['collection']}/items", json=test_item
# )
# assert resp.status_code == 200
# assert resp.json()["properties"]["foo"] == "hello"
#
# # Search for the item
# body = {"query": {"foo": {"eq": "hello"}}}
# resp = test_client.post("/search", json=body)
# assert resp.status_code == 200
# resp_json = resp.json()
# assert len(resp_json["features"]) == 1
# assert resp_json["features"][0]["properties"]["foo"] == "hello"
#
# # Cleanup
# transactions.delete_item(test_item["id"], request=MockStarletteRequest)
# transactions.delete_collection(coll.id, request=MockStarletteRequest)
# db_session.writer.cached_engine.execute(
# "ALTER TABLE data.items DROP COLUMN foo"
# )
| 37.263158 | 86 | 0.659251 | 316 | 2,832 | 5.737342 | 0.335443 | 0.039713 | 0.041368 | 0.038058 | 0.146718 | 0.095974 | 0.095974 | 0.058467 | 0.058467 | 0.058467 | 0 | 0.00544 | 0.221045 | 2,832 | 75 | 87 | 37.76 | 0.81641 | 0.944209 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.013333 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4014cde7f14af6f44fe925623e8fa0bed481db48 | 226 | py | Python | common/__init__.py | funnyzak/cms-scripting | 6074acd3eaf734e8df43d245e6e6415a5500d01e | [
"MIT"
] | 1 | 2021-11-03T02:09:15.000Z | 2021-11-03T02:09:15.000Z | common/__init__.py | funnyzak/cms-scripting | 6074acd3eaf734e8df43d245e6e6415a5500d01e | [
"MIT"
] | null | null | null | common/__init__.py | funnyzak/cms-scripting | 6074acd3eaf734e8df43d245e6e6415a5500d01e | [
"MIT"
] | null | null | null | from .fileutil import FileUtil
from .exception import PException
from .ziputil import ZipUtil
from .logger import new_logger
from .logger import logger
from .execlutil import ExeclUtil
from . import imgutil
from . import util
| 25.111111 | 33 | 0.823009 | 31 | 226 | 5.967742 | 0.354839 | 0.108108 | 0.172973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141593 | 226 | 8 | 34 | 28.25 | 0.953608 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
401be2ecedd4ee9be398b4daa69efb1cff7803c5 | 102 | py | Python | sending.py | skyrred/django-pa | d53815992ef680e48ce9579d1e7c76d1009b7f6d | [
"Apache-2.0"
] | null | null | null | sending.py | skyrred/django-pa | d53815992ef680e48ce9579d1e7c76d1009b7f6d | [
"Apache-2.0"
] | null | null | null | sending.py | skyrred/django-pa | d53815992ef680e48ce9579d1e7c76d1009b7f6d | [
"Apache-2.0"
] | null | null | null | import webbrowser
webbrowser.open("http://127.0.0.1:8000/share")
print("updating is done")
input("") | 20.4 | 46 | 0.715686 | 16 | 102 | 4.5625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106383 | 0.078431 | 102 | 5 | 47 | 20.4 | 0.670213 | 0 | 0 | 0 | 0 | 0 | 0.417476 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
403904fc5aefaef8b84ae8a9bf6da3648de20c2d | 332 | py | Python | src/leituraDeArquivo.py | jefersoncmn/Genetic-Algorithm | 49b07d3385b5c92d74405108c7a945530e2c9b21 | [
"MIT"
] | null | null | null | src/leituraDeArquivo.py | jefersoncmn/Genetic-Algorithm | 49b07d3385b5c92d74405108c7a945530e2c9b21 | [
"MIT"
] | 7 | 2021-08-09T13:09:12.000Z | 2021-08-29T10:20:40.000Z | src/leituraDeArquivo.py | jefersoncmn/Genetic-Algorithm | 49b07d3385b5c92d74405108c7a945530e2c9b21 | [
"MIT"
] | null | null | null | import pandas as pd
import json
def ler_json(arq_json):
with open(arq_json, 'r', encoding='utf8') as f:
return json.load(f)
def ler_materia_no_json(json_data, line):
materia = json_data[line]
return materia
def ler_dado_da_materia_no_json(json_data, line, key):
dado = json_data[line][key]
return dado | 23.714286 | 54 | 0.710843 | 56 | 332 | 3.946429 | 0.410714 | 0.144796 | 0.217195 | 0.153846 | 0.226244 | 0.226244 | 0 | 0 | 0 | 0 | 0 | 0.003717 | 0.189759 | 332 | 14 | 55 | 23.714286 | 0.817844 | 0 | 0 | 0 | 0 | 0 | 0.015015 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.181818 | 0 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
403d4dca31a70e020084d35100fc6acd19e3fd05 | 564 | py | Python | scripts/models/repositories.py | omarowns/crucible | 4cc2c353dbdba18fcb683a21d4bf12374d848488 | [
"MIT"
] | null | null | null | scripts/models/repositories.py | omarowns/crucible | 4cc2c353dbdba18fcb683a21d4bf12374d848488 | [
"MIT"
] | null | null | null | scripts/models/repositories.py | omarowns/crucible | 4cc2c353dbdba18fcb683a21d4bf12374d848488 | [
"MIT"
] | null | null | null | import yaml
import os
class YamlRepository():
def __init__(self, file_name):
file_path = os.path.join(os.path.dirname(__file__), '../data', file_name)
with open(file_path, 'r') as file:
self.source = yaml.safe_load(file)
class ZoneRepository(YamlRepository):
def __init__(self):
super().__init__('zones.yml')
self.zones = self.source.get('zones')
class ActionRepository(YamlRepository):
def __init__(self) -> None:
super().__init__('actions.yml')
self.actions = self.source.get('actions') | 29.684211 | 81 | 0.654255 | 69 | 564 | 4.927536 | 0.42029 | 0.15 | 0.185294 | 0.220588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.203901 | 564 | 19 | 82 | 29.684211 | 0.757238 | 0 | 0 | 0 | 0 | 0 | 0.070796 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.133333 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
40499e2b005625789e7b14b938a341e99bae89ef | 24,566 | py | Python | pysnmp_mibs/CHARACTER-MIB.py | jackjack821/pysnmp-mibs | 9835ea0bb2420715caf4ee9aaa07d59bb263acd6 | [
"BSD-2-Clause"
] | 6 | 2017-04-21T13:48:08.000Z | 2022-01-06T19:42:52.000Z | pysnmp_mibs/CHARACTER-MIB.py | jackjack821/pysnmp-mibs | 9835ea0bb2420715caf4ee9aaa07d59bb263acd6 | [
"BSD-2-Clause"
] | 1 | 2020-05-05T16:42:25.000Z | 2020-05-05T16:42:25.000Z | pysnmp_mibs/CHARACTER-MIB.py | jackjack821/pysnmp-mibs | 9835ea0bb2420715caf4ee9aaa07d59bb263acd6 | [
"BSD-2-Clause"
] | 6 | 2020-02-08T20:28:49.000Z | 2021-09-14T13:36:46.000Z | #
# PySNMP MIB module CHARACTER-MIB (http://pysnmp.sf.net)
# ASN.1 source http://mibs.snmplabs.com:80/asn1/CHARACTER-MIB
# Produced by pysmi-0.0.7 at Sun Feb 14 00:06:47 2016
# On host bldfarm platform Linux version 4.1.13-100.fc21.x86_64 by user goose
# Using Python version 3.5.0 (default, Jan 5 2016, 17:11:52)
#
( ObjectIdentifier, OctetString, Integer, ) = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
( NamedValues, ) = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
( ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ) = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint")
( InterfaceIndex, ) = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
( ObjectGroup, NotificationGroup, ModuleCompliance, ) = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
( MibIdentifier, transmission, Bits, Integer32, IpAddress, Gauge32, mib_2, Counter32, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Unsigned32, ObjectIdentity, TimeTicks, ModuleIdentity, NotificationType, ) = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "transmission", "Bits", "Integer32", "IpAddress", "Gauge32", "mib-2", "Counter32", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Unsigned32", "ObjectIdentity", "TimeTicks", "ModuleIdentity", "NotificationType")
( TextualConvention, DisplayString, AutonomousType, InstancePointer, ) = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "AutonomousType", "InstancePointer")
char = ModuleIdentity((1, 3, 6, 1, 2, 1, 19))
if mibBuilder.loadTexts: char.setLastUpdated('9405261700Z')
if mibBuilder.loadTexts: char.setOrganization('IETF Character MIB Working Group')
if mibBuilder.loadTexts: char.setContactInfo(' Bob Stewart\n Postal: Xyplex, Inc.\n 295 Foster Street\n Littleton, MA 01460\n\n Tel: 508-952-4816\n Fax: 508-952-4887\n\n E-mail: rlstewart@eng.xyplex.com')
if mibBuilder.loadTexts: char.setDescription('The MIB module for character stream devices.')
class PortIndex(Integer32, TextualConvention):
displayHint = 'd'
charNumber = MibScalar((1, 3, 6, 1, 2, 1, 19, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charNumber.setDescription('The number of entries in charPortTable, regardless\n of their current state.')
charPortTable = MibTable((1, 3, 6, 1, 2, 1, 19, 2), )
if mibBuilder.loadTexts: charPortTable.setDescription('A list of port entries. The number of entries is\n given by the value of charNumber.')
charPortEntry = MibTableRow((1, 3, 6, 1, 2, 1, 19, 2, 1), ).setIndexNames((0, "CHARACTER-MIB", "charPortIndex"))
if mibBuilder.loadTexts: charPortEntry.setDescription('Status and parameter values for a character port.')
charPortIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 1), PortIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortIndex.setDescription('A unique value for each character port, perhaps\n corresponding to the same value of ifIndex when the\n character port is associated with a hardware port\n represented by an ifIndex.')
charPortName = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0,32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortName.setDescription('An administratively assigned name for the port,\n typically with some local significance.')
charPortType = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("physical", 1), ("virtual", 2),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortType.setDescription("The port's type, 'physical' if the port represents\n an external hardware connector, 'virtual' if it does\n not.")
charPortHardware = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 4), AutonomousType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortHardware.setDescription("A reference to hardware MIB definitions specific to\n a physical port's external connector. For example,\n if the connector is RS-232, then the value of this\n object refers to a MIB sub-tree defining objects\n specific to RS-232. If an agent is not configured\n to have such values, the agent returns the object\n identifier:\n\n nullHardware OBJECT IDENTIFIER ::= { 0 0 }\n ")
charPortReset = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortReset.setDescription("A control to force the port into a clean, initial\n state, both hardware and software, disconnecting all\n the port's existing sessions. In response to a\n get-request or get-next-request, the agent always\n returns 'ready' as the value. Setting the value to\n 'execute' causes a reset.")
charPortAdminStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("off", 3), ("maintenance", 4),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortAdminStatus.setDescription("The port's desired state, independent of flow\n control. 'enabled' indicates that the port is\n allowed to pass characters and form new sessions.\n 'disabled' indicates that the port is allowed to\n pass characters but not form new sessions. 'off'\n indicates that the port is not allowed to pass\n characters or have any sessions. 'maintenance'\n indicates a maintenance mode, exclusive of normal\n operation, such as running a test.\n\n 'enabled' corresponds to ifAdminStatus 'up'.\n 'disabled' and 'off' correspond to ifAdminStatus\n 'down'. 'maintenance' corresponds to ifAdminStatus\n 'test'.")
charPortOperStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("maintenance", 3), ("absent", 4), ("active", 5),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortOperStatus.setDescription("The port's actual, operational state, independent\n of flow control. 'up' indicates able to function\n normally. 'down' indicates inability to function\n for administrative or operational reasons.\n 'maintenance' indicates a maintenance mode,\n exclusive of normal operation, such as running a\n test. 'absent' indicates that port hardware is not\n present. 'active' indicates up with a user present\n (e.g. logged in).\n\n 'up' and 'active' correspond to ifOperStatus 'up'.\n 'down' and 'absent' correspond to ifOperStatus\n 'down'. 'maintenance' corresponds to ifOperStatus\n 'test'.")
charPortLastChange = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 8), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortLastChange.setDescription('The value of sysUpTime at the time the port entered\n its current operational state. If the current state\n was entered prior to the last reinitialization of\n the local network management subsystem, then this\n object contains a zero value.')
charPortInFlowType = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("none", 1), ("xonXoff", 2), ("hardware", 3), ("ctsRts", 4), ("dsrDtr", 5),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortInFlowType.setDescription("The port's type of input flow control. 'none'\n indicates no flow control at this level or below.\n 'xonXoff' indicates software flow control by\n recognizing XON and XOFF characters. 'hardware'\n indicates flow control delegated to the lower level,\n for example a parallel port.\n\n 'ctsRts' and 'dsrDtr' are specific to RS-232-like\n ports. Although not architecturally pure, they are\n included here for simplicity's sake.")
charPortOutFlowType = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5,))).clone(namedValues=NamedValues(("none", 1), ("xonXoff", 2), ("hardware", 3), ("ctsRts", 4), ("dsrDtr", 5),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortOutFlowType.setDescription("The port's type of output flow control. 'none'\n indicates no flow control at this level or below.\n 'xonXoff' indicates software flow control by\n recognizing XON and XOFF characters. 'hardware'\n indicates flow control delegated to the lower level,\n for example a parallel port.\n\n 'ctsRts' and 'dsrDtr' are specific to RS-232-like\n ports. Although not architecturally pure, they are\n included here for simplicy's sake.")
charPortInFlowState = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("stop", 3), ("go", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortInFlowState.setDescription("The current operational state of input flow control\n on the port. 'none' indicates not applicable.\n 'unknown' indicates this level does not know.\n 'stop' indicates flow not allowed. 'go' indicates\n flow allowed.")
charPortOutFlowState = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("none", 1), ("unknown", 2), ("stop", 3), ("go", 4),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortOutFlowState.setDescription("The current operational state of output flow\n control on the port. 'none' indicates not\n applicable. 'unknown' indicates this level does not\n know. 'stop' indicates flow not allowed. 'go'\n indicates flow allowed.")
charPortInCharacters = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 13), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortInCharacters.setDescription("Total number of characters detected as input from\n the port since system re-initialization and while\n the port operational state was 'up', 'active', or\n 'maintenance', including, for example, framing, flow\n control (i.e. XON and XOFF), each occurrence of a\n BREAK condition, locally-processed input, and input\n sent to all sessions.")
charPortOutCharacters = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortOutCharacters.setDescription("Total number of characters detected as output to\n the port since system re-initialization and while\n the port operational state was 'up', 'active', or\n 'maintenance', including, for example, framing, flow\n control (i.e. XON and XOFF), each occurrence of a\n BREAK condition, locally-created output, and output\n received from all sessions.")
charPortAdminOrigin = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4,))).clone(namedValues=NamedValues(("dynamic", 1), ("network", 2), ("local", 3), ("none", 4),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortAdminOrigin.setDescription("The administratively allowed origin for\n establishing session on the port. 'dynamic' allows\n 'network' or 'local' session establishment. 'none'\n disallows session establishment.")
charPortSessionMaximum = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1,2147483647))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortSessionMaximum.setDescription('The maximum number of concurrent sessions allowed\n on the port. A value of -1 indicates no maximum.\n Setting the maximum to less than the current number\n of sessions has unspecified results.')
charPortSessionNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 17), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortSessionNumber.setDescription('The number of open sessions on the port that are in\n the connecting, connected, or disconnecting state.')
charPortSessionIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0,2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortSessionIndex.setDescription("The value of charSessIndex for the port's first or\n only active session. If the port has no active\n session, the agent returns the value zero.")
charPortInFlowTypes = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 19), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1,1)).setFixedLength(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortInFlowTypes.setDescription("The port's types of input flow control at the\n software level. Hardware-level flow control is\n independently controlled by the appropriate\n hardware-level MIB.\n\n A value of zero indicates no flow control.\n Depending on the specific implementation, any or\n all combinations of flow control may be chosen by\n adding the values:\n\n 128 xonXoff, recognizing XON and XOFF characters\n 64 enqHost, ENQ/ACK to allow input to host\n 32 enqTerm, ACK to allow output to port\n ")
charPortOutFlowTypes = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 20), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1,1)).setFixedLength(1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charPortOutFlowTypes.setDescription("The port's types of output flow control at the\n software level. Hardware-level flow control is\n independently controlled by the appropriate\n hardware-level MIB.\n\n A value of zero indicates no flow control.\n Depending on the specific implementation, any or\n all combinations of flow control may be chosen by\n adding the values:\n\n 128 xonXoff, recognizing XON and XOFF characters\n 64 enqHost, ENQ/ACK to allow input to host\n 32 enqTerm, ACK to allow output to port\n ")
charPortLowerIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 2, 1, 21), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charPortLowerIfIndex.setDescription('The ifIndex value of the lower level hardware supporting\n this character port, zero if none.')
charSessTable = MibTable((1, 3, 6, 1, 2, 1, 19, 3), )
if mibBuilder.loadTexts: charSessTable.setDescription('A list of port session entries.')
charSessEntry = MibTableRow((1, 3, 6, 1, 2, 1, 19, 3, 1), ).setIndexNames((0, "CHARACTER-MIB", "charSessPortIndex"), (0, "CHARACTER-MIB", "charSessIndex"))
if mibBuilder.loadTexts: charSessEntry.setDescription('Status and parameter values for a character port\n session.')
charSessPortIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 1), PortIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessPortIndex.setDescription('The value of charPortIndex for the port to which\n this session belongs.')
charSessIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1,2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessIndex.setDescription('The session index in the context of the port, a\n non-zero positive integer. Session indexes within a\n port need not be sequential. Session indexes may be\n reused for different ports. For example, port 1 and\n port 3 may both have a session 2 at the same time.\n Session indexes may have any valid integer value,\n with any meaning convenient to the agent\n implementation.')
charSessKill = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2,))).clone(namedValues=NamedValues(("ready", 1), ("execute", 2),))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: charSessKill.setDescription("A control to terminate the session. In response to\n a get-request or get-next-request, the agent always\n returns 'ready' as the value. Setting the value to\n 'execute' causes termination.")
charSessState = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("connecting", 1), ("connected", 2), ("disconnecting", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessState.setDescription("The current operational state of the session,\n disregarding flow control. 'connected' indicates\n that character data could flow on the network side\n of session. 'connecting' indicates moving from\n nonexistent toward 'connected'. 'disconnecting'\n indicates moving from 'connected' or 'connecting' to\n nonexistent.")
charSessProtocol = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 5), AutonomousType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessProtocol.setDescription('The network protocol over which the session is\n running. Other OBJECT IDENTIFIER values may be\n defined elsewhere, in association with specific\n protocols. However, this document assigns those of\n known interest as of this writing.')
wellKnownProtocols = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4))
protocolOther = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 1))
protocolTelnet = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 2))
protocolRlogin = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 3))
protocolLat = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 4))
protocolX29 = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 5))
protocolVtp = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 4, 6))
charSessOperOrigin = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3,))).clone(namedValues=NamedValues(("unknown", 1), ("network", 2), ("local", 3),))).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessOperOrigin.setDescription("The session's source of establishment.")
charSessInCharacters = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessInCharacters.setDescription("This session's subset of charPortInCharacters.")
charSessOutCharacters = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessOutCharacters.setDescription("This session's subset of charPortOutCharacters.")
charSessConnectionId = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 9), InstancePointer()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessConnectionId.setDescription('A reference to additional local MIB information.\n This should be the highest available related MIB,\n corresponding to charSessProtocol, such as Telnet.\n For example, the value for a TCP connection (in the\n absence of a Telnet MIB) is the object identifier of\n tcpConnState. If an agent is not configured to have\n such values, the agent returns the object\n identifier:\n\n nullConnectionId OBJECT IDENTIFIER ::= { 0 0 }\n ')
charSessStartTime = MibTableColumn((1, 3, 6, 1, 2, 1, 19, 3, 1, 10), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: charSessStartTime.setDescription('The value of sysUpTime in MIB-2 when the session\n entered connecting state.')
charConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 5))
charGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 5, 1))
charCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 19, 5, 2))
charCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 19, 5, 2, 1)).setObjects(*(("CHARACTER-MIB", "charGroup"),))
if mibBuilder.loadTexts: charCompliance.setDescription('The compliance statement for SNMPv2 entities\n which have Character hardware interfaces.')
charGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 19, 5, 1, 1)).setObjects(*(("CHARACTER-MIB", "charNumber"), ("CHARACTER-MIB", "charPortIndex"), ("CHARACTER-MIB", "charPortName"), ("CHARACTER-MIB", "charPortType"), ("CHARACTER-MIB", "charPortHardware"), ("CHARACTER-MIB", "charPortReset"), ("CHARACTER-MIB", "charPortAdminStatus"), ("CHARACTER-MIB", "charPortOperStatus"), ("CHARACTER-MIB", "charPortLastChange"), ("CHARACTER-MIB", "charPortInFlowState"), ("CHARACTER-MIB", "charPortOutFlowState"), ("CHARACTER-MIB", "charPortAdminOrigin"), ("CHARACTER-MIB", "charPortSessionMaximum"), ("CHARACTER-MIB", "charPortInFlowTypes"), ("CHARACTER-MIB", "charPortOutFlowTypes"), ("CHARACTER-MIB", "charPortInCharacters"), ("CHARACTER-MIB", "charPortOutCharacters"), ("CHARACTER-MIB", "charPortSessionNumber"), ("CHARACTER-MIB", "charPortSessionIndex"), ("CHARACTER-MIB", "charPortLowerIfIndex"), ("CHARACTER-MIB", "charSessPortIndex"), ("CHARACTER-MIB", "charSessIndex"), ("CHARACTER-MIB", "charSessKill"), ("CHARACTER-MIB", "charSessState"), ("CHARACTER-MIB", "charSessProtocol"), ("CHARACTER-MIB", "charSessOperOrigin"), ("CHARACTER-MIB", "charSessInCharacters"), ("CHARACTER-MIB", "charSessOutCharacters"), ("CHARACTER-MIB", "charSessConnectionId"), ("CHARACTER-MIB", "charSessStartTime"),))
if mibBuilder.loadTexts: charGroup.setDescription('A collection of objects providing information\n applicable to all Character interfaces.')
mibBuilder.exportSymbols("CHARACTER-MIB", protocolOther=protocolOther, charPortAdminOrigin=charPortAdminOrigin, charPortSessionMaximum=charPortSessionMaximum, charSessIndex=charSessIndex, charSessInCharacters=charSessInCharacters, charPortAdminStatus=charPortAdminStatus, charSessEntry=charSessEntry, charNumber=charNumber, charPortType=charPortType, charSessKill=charSessKill, protocolRlogin=protocolRlogin, charCompliance=charCompliance, charPortInCharacters=charPortInCharacters, charPortLowerIfIndex=charPortLowerIfIndex, charPortOutFlowState=charPortOutFlowState, charConformance=charConformance, charSessConnectionId=charSessConnectionId, charPortOutCharacters=charPortOutCharacters, charSessStartTime=charSessStartTime, charSessOutCharacters=charSessOutCharacters, wellKnownProtocols=wellKnownProtocols, charPortIndex=charPortIndex, charPortReset=charPortReset, charPortInFlowType=charPortInFlowType, charPortHardware=charPortHardware, protocolLat=protocolLat, charPortLastChange=charPortLastChange, charPortSessionIndex=charPortSessionIndex, protocolVtp=protocolVtp, charSessTable=charSessTable, charSessProtocol=charSessProtocol, charSessOperOrigin=charSessOperOrigin, charPortOutFlowTypes=charPortOutFlowTypes, protocolTelnet=protocolTelnet, charPortOutFlowType=charPortOutFlowType, charPortTable=charPortTable, charPortInFlowState=charPortInFlowState, charSessPortIndex=charSessPortIndex, PortIndex=PortIndex, charPortSessionNumber=charPortSessionNumber, charCompliances=charCompliances, PYSNMP_MODULE_ID=char, charGroups=charGroups, charPortEntry=charPortEntry, charPortInFlowTypes=charPortInFlowTypes, charPortOperStatus=charPortOperStatus, charGroup=charGroup, charPortName=charPortName, charSessState=charSessState, char=char, protocolX29=protocolX29)
| 223.327273 | 1,766 | 0.715013 | 2,982 | 24,566 | 5.889001 | 0.167337 | 0.0082 | 0.011389 | 0.011161 | 0.440522 | 0.386595 | 0.318945 | 0.304709 | 0.295712 | 0.274529 | 0 | 0.041782 | 0.164089 | 24,566 | 109 | 1,767 | 225.376147 | 0.813392 | 0.012293 | 0 | 0 | 0 | 0.247525 | 0.511812 | 0.008081 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.009901 | 0.069307 | 0 | 0.089109 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40566d1131d9c55b8b9428759d818c777e295eae | 88 | py | Python | flask_babel_bundle/extensions/__init__.py | briancappello/flask-babel-bundle | a9ecbf53278d4b01ae7f8f811f6974ea42045986 | [
"MIT"
] | null | null | null | flask_babel_bundle/extensions/__init__.py | briancappello/flask-babel-bundle | a9ecbf53278d4b01ae7f8f811f6974ea42045986 | [
"MIT"
] | null | null | null | flask_babel_bundle/extensions/__init__.py | briancappello/flask-babel-bundle | a9ecbf53278d4b01ae7f8f811f6974ea42045986 | [
"MIT"
] | null | null | null | from flask_babelex import Babel
babel = Babel()
EXTENSIONS = {
'babel': babel,
}
| 9.777778 | 31 | 0.659091 | 10 | 88 | 5.7 | 0.6 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.227273 | 88 | 8 | 32 | 11 | 0.838235 | 0 | 0 | 0 | 0 | 0 | 0.056818 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
405ef9f5742f06ef10764a8d4530ef80913001ad | 115 | py | Python | dictionaries.py | larrymahumot/hello | 7f32e8484f541a6944ff229114b3536e924f6d88 | [
"Unlicense"
] | null | null | null | dictionaries.py | larrymahumot/hello | 7f32e8484f541a6944ff229114b3536e924f6d88 | [
"Unlicense"
] | null | null | null | dictionaries.py | larrymahumot/hello | 7f32e8484f541a6944ff229114b3536e924f6d88 | [
"Unlicense"
] | null | null | null | houses = {"Harry": "Gryffindor", "Draco": "Slytherin"}
houses["Hermione"] = "Gryffindor"
print(houses["Harry"])
| 16.428571 | 54 | 0.652174 | 11 | 115 | 6.818182 | 0.636364 | 0.293333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113043 | 115 | 6 | 55 | 19.166667 | 0.735294 | 0 | 0 | 0 | 0 | 0 | 0.45614 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40676f1dc9aaa07801f702d961fe4cf2de6727b0 | 11 | py | Python | dev.py | AugustPython/git_ssh | 461623d95f586812e4b5c5e3234783eceec77a93 | [
"MIT"
] | null | null | null | dev.py | AugustPython/git_ssh | 461623d95f586812e4b5c5e3234783eceec77a93 | [
"MIT"
] | null | null | null | dev.py | AugustPython/git_ssh | 461623d95f586812e4b5c5e3234783eceec77a93 | [
"MIT"
] | null | null | null | name = dev
| 5.5 | 10 | 0.636364 | 2 | 11 | 3.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 11 | 1 | 11 | 11 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40abee05921b04e7051f087863537b4723de5559 | 4,777 | py | Python | spectralpool.py | AlbertZhangHIT/Hartley-spectral-pooling | c14ef45ab07abf4b7063e217e3b60bcddd9d95e7 | [
"MIT"
] | 6 | 2019-09-27T00:43:45.000Z | 2021-08-25T01:23:02.000Z | spectralpool.py | AlbertZhangHIT/Hartley-spectral-pooling | c14ef45ab07abf4b7063e217e3b60bcddd9d95e7 | [
"MIT"
] | 2 | 2019-11-06T07:28:51.000Z | 2020-03-15T20:26:18.000Z | spectralpool.py | AlbertZhangHIT/Hartley-spectral-pooling | c14ef45ab07abf4b7063e217e3b60bcddd9d95e7 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Function
import math
from torch.nn.modules.utils import _pair
def _spectral_crop(input, oheight, owidth):
cutoff_freq_h = math.ceil(oheight / 2)
cutoff_freq_w = math.ceil(owidth / 2)
if oheight % 2 == 1:
if owidth % 2 == 1:
top_left = input[:, :, :cutoff_freq_h, :cutoff_freq_w]
top_right = input[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):]
bottom_left = input[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w]
bottom_right = input[:, :, -(cutoff_freq_h-1):, -(cutoff_freq_w-1):]
else:
top_left = input[:, :, :cutoff_freq_h, :cutoff_freq_w]
top_right = input[:, :, :cutoff_freq_h, -cutoff_freq_w:]
bottom_left = input[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w]
bottom_right = input[:, :, -(cutoff_freq_h-1):, -cutoff_freq_w:]
else:
if owidth % 2 == 1:
top_left = input[:, :, :cutoff_freq_h, :cutoff_freq_w]
top_right = input[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):]
bottom_left = input[:, :, -cutoff_freq_h:, :cutoff_freq_w]
bottom_right = input[:, :, -cutoff_freq_h:, -(cutoff_freq_w-1):]
else:
top_left = input[:, :, :cutoff_freq_h, :cutoff_freq_w]
top_right = input[:, :, :cutoff_freq_h, -cutoff_freq_w:]
bottom_left = input[:, :, -cutoff_freq_h:, :cutoff_freq_w]
bottom_right = input[:, :, -cutoff_freq_h:, -cutoff_freq_w:]
top_combined = torch.cat((top_left, top_right), dim=-1)
bottom_combined = torch.cat((bottom_left, bottom_right), dim=-1)
all_together = torch.cat((top_combined, bottom_combined), dim=-2)
return all_together
def _spectral_pad(input, output, oheight, owidth):
cutoff_freq_h = math.ceil(oheight / 2)
cutoff_freq_w = math.ceil(owidth / 2)
pad = torch.zeros_like(input)
if oheight % 2 == 1:
if owidth % 2 == 1:
pad[:, :, :cutoff_freq_h, :cutoff_freq_w] = output[:, :, :cutoff_freq_h, :cutoff_freq_w]
pad[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):] = output[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):]
pad[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w] = output[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w]
pad[:, :, -(cutoff_freq_h-1):, -(cutoff_freq_w-1):] = output[:, :, -(cutoff_freq_h-1):, -(cutoff_freq_w-1):]
else:
pad[:, :, :cutoff_freq_h, :cutoff_freq_w] = output[:, :, :cutoff_freq_h, :cutoff_freq_w]
pad[:, :, :cutoff_freq_h, -cutoff_freq_w:] = output[:, :, :cutoff_freq_h, -cutoff_freq_w:]
pad[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w] = output[:, :, -(cutoff_freq_h-1):, :cutoff_freq_w]
pad[:, :, -(cutoff_freq_h-1):, -cutoff_freq_w:] = output[:, :, -(cutoff_freq_h-1):, -cutoff_freq_w:]
else:
if owidth % 2 == 1:
pad[:, :, :cutoff_freq_h, :cutoff_freq_w] = output[:, :, :cutoff_freq_h, :cutoff_freq_w]
pad[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):] = output[:, :, :cutoff_freq_h, -(cutoff_freq_w-1):]
pad[:, :, -cutoff_freq_h:, :cutoff_freq_w] = output[:, :, -cutoff_freq_h:, :cutoff_freq_w]
pad[:, :, -cutoff_freq_h:, -(cutoff_freq_w-1):] = output[:, :, -cutoff_freq_h:, -(cutoff_freq_w-1):]
else:
pad[:, :, :cutoff_freq_h, :cutoff_freq_w] = output[:, :, :cutoff_freq_h, :cutoff_freq_w]
pad[:, :, :cutoff_freq_h, -cutoff_freq_w:] = output[:, :, :cutoff_freq_h, -cutoff_freq_w:]
pad[:, :, -cutoff_freq_h:, :cutoff_freq_w] = output[:, :, -cutoff_freq_h:, :cutoff_freq_w]
pad[:, :, -cutoff_freq_h:, -cutoff_freq_w:] = output[:, :, -cutoff_freq_h:, -cutoff_freq_w:]
return pad
def DiscreteHartleyTransform(input):
fft = torch.rfft(input, 2, normalized=True, onesided=False)
dht = fft[:, :, :, :, -2] - fft[:, :, :, :, -1]
return dht
class SpectralPoolingFunction(Function):
@staticmethod
def forward(ctx, input, oheight, owidth):
ctx.oh = oheight
ctx.ow = owidth
ctx.save_for_backward(input)
# Hartley transform by RFFT
dht = DiscreteHartleyTransform(input)
# frequency cropping
all_together = _spectral_crop(dht, oheight, owidth)
# inverse Hartley transform
dht = DiscreteHartleyTransform(all_together)
return dht
@staticmethod
def backward(ctx, grad_output):
input, = ctx.saved_variables
# Hartley transform by RFFT
dht = DiscreteHartleyTransform(grad_output)
# frequency padding
grad_input = _spectral_pad(input, dht, ctx.oh, ctx.ow)
# inverse Hartley transform
grad_input = DiscreteHartleyTransform(grad_input)
return grad_input, None, None
class SpectralPool2d(nn.Module):
def __init__(self, scale_factor):
super(SpectralPool2d, self).__init__()
self.scale_factor = _pair(scale_factor)
def forward(self, input):
H, W = input.size(-2), input.size(-1)
h, w = math.ceil(H*self.scale_factor[0]), math.ceil(W*self.scale_factor[1])
return SpectralPoolingFunction.apply(input, h, w)
| 41.903509 | 112 | 0.660666 | 685 | 4,777 | 4.226277 | 0.115328 | 0.345423 | 0.189983 | 0.211399 | 0.610363 | 0.610363 | 0.576511 | 0.576511 | 0.565458 | 0.561313 | 0 | 0.013036 | 0.164957 | 4,777 | 113 | 113 | 42.274336 | 0.71271 | 0.029307 | 0 | 0.488889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.077778 | false | 0 | 0.055556 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40aebc443ae4659272f7031f802901bcd21560b6 | 510 | py | Python | app/__init__.py | jillmnolan/cascade-server | 313c2ccfc061740c0ef664e97bce60546008b9b2 | [
"Apache-2.0"
] | null | null | null | app/__init__.py | jillmnolan/cascade-server | 313c2ccfc061740c0ef664e97bce60546008b9b2 | [
"Apache-2.0"
] | null | null | null | app/__init__.py | jillmnolan/cascade-server | 313c2ccfc061740c0ef664e97bce60546008b9b2 | [
"Apache-2.0"
] | null | null | null | # NOTICE
#
# This software was produced for the U. S. Government
# under Basic Contract No. W15P7T-13-C-A802, and is
# subject to the Rights in Noncommercial Computer Software
# and Noncommercial Computer Software Documentation
# Clause 252.227-7014 (FEB 2012)
#
# (C) 2017 The MITRE Corporation.
from __future__ import print_function
import sys
from . import async
from . import server
from . import api
from . import users
from . import utils
from . import ws
from . import docs
from . import plugin_loader | 24.285714 | 58 | 0.768627 | 76 | 510 | 5.078947 | 0.671053 | 0.207254 | 0.150259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061466 | 0.170588 | 510 | 21 | 59 | 24.285714 | 0.851064 | 0.545098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 1 | null | null | 0.1 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
40af229d59fd56cd49fa0e5daabe829a95283f96 | 3,780 | py | Python | senpaibot/reading/reading_list.py | Maronato/GEAvBot | b5fe955b39211c7310e50aab35aa60b052fdc79c | [
"MIT"
] | null | null | null | senpaibot/reading/reading_list.py | Maronato/GEAvBot | b5fe955b39211c7310e50aab35aa60b052fdc79c | [
"MIT"
] | null | null | null | senpaibot/reading/reading_list.py | Maronato/GEAvBot | b5fe955b39211c7310e50aab35aa60b052fdc79c | [
"MIT"
] | null | null | null | from datetime import datetime
from apiclient.discovery import build
import json
from senpaibot.orderedset import OrderedSet
class BaseReadingList:
def get_reading_list(self):
raise NotImplemented
def get_undated_reading_set(self):
raise NotImplemented
@property
def reading_list(self):
return self.get_reading_list()
@property
def undated_reading_set(self):
return self.get_undated_reading_set()
class HardcodedReadingList(BaseReadingList):
"""Hardcoded Reading List
Loads hardcoded data
"""
_reading_list = [
('Capítulo 1', datetime(2018, 5, 22)),
('Capítulo 2', datetime(2018, 6, 10)),
('Capítulo 3', datetime(2018, 6, 11)),
('Capítulo 4', datetime(2018, 6, 12)),
('Capítulo 5', datetime(2018, 7, 10)),
('Capítulo 6', datetime(2018, 7, 11)),
('Capítulo 7', datetime(2018, 7, 12)),
]
def get_reading_list(self):
return self._reading_list
def get_undated_reading_set(self):
return OrderedSet([read[0] for read in self.reading_list])
class JsonReadingList(BaseReadingList):
"""Json Reading List
Loads json strings in the format:
[
['Cap title', '23/09/18'],
['Cap title 2', '05/10/18']
]
"""
datetime_format = '%d/%m/%y'
def __init__(self, json):
self.json = json
def get_json(self):
return self.json
def load_json(self):
return json.loads(self.get_json())
def date_format_function(self):
return lambda row: (row[0], datetime.strptime(row[1], self.datetime_format))
def format_data(self, data):
return map(self.date_format_function(), data)
def get_data(self):
return self.format_data(self.load_json())
def get_reading_list(self):
return self.get_data()
def get_undated_reading_set(self):
return OrderedSet([read[0] for read in self.reading_list])
class FileReadingList(JsonReadingList):
"""File Reading List
Loads json files in the format:
[
['Cap title', '23/09/18'],
['Cap title 2', '05/10/18']
]
"""
def __init__(self, file):
self.file = file
def get_file_path(self):
return self.file
def get_file(self):
return open(self.get_file_path())
def load_json(self):
return json.load(self.get_file())
class GoogleSpreadsheetReadingList(JsonReadingList):
"""Google Spreadsheet Reading List
Loads data from a google spreadsheet in the format:
Book 1 | Chapter 2 | 14/05/18
"""
def __init__(self, sheet_id, sheet_range, api_key):
self.sheet_id = sheet_id
self.api_key = api_key
self.sheet_range = sheet_range
self.data = list(self.get_data())
def get_service(self):
return build('sheets', 'v4', developerKey=self.api_key)
def spreadsheet_format_function(self):
return lambda row: (', capítulo '.join(row[:2]), datetime.strptime(row[2], self.datetime_format))
def format_spreadsheet_data(self, data):
return map(self.spreadsheet_format_function(), data)
def get_data(self):
service = self.get_service()
spreadsheet = service.spreadsheets().values().get(spreadsheetId=self.sheet_id, range=self.sheet_range)
data = spreadsheet.execute().get('values', [])
return self.format_spreadsheet_data(data)
def get_reading_list(self):
return self.data
def get_default_list():
import os
sheet_id = os.environ.get('GOOGLE_SHEET_ID')
api_key = os.environ.get('GOOGLE_API_KEY')
sheet_range = os.environ.get('GOOGLE_SHEET_RANGE')
reading_list = GoogleSpreadsheetReadingList(sheet_id, sheet_range, api_key)
return reading_list
| 25.714286 | 110 | 0.651852 | 487 | 3,780 | 4.843943 | 0.190965 | 0.074608 | 0.047478 | 0.028826 | 0.351844 | 0.280203 | 0.165748 | 0.099195 | 0.099195 | 0.099195 | 0 | 0.03346 | 0.233069 | 3,780 | 146 | 111 | 25.890411 | 0.780269 | 0.105291 | 0 | 0.207317 | 0 | 0 | 0.045607 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.304878 | false | 0 | 0.060976 | 0.219512 | 0.695122 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
40b43b074de55f7529cfa829674c1029f70e4bae | 535 | py | Python | django-rgd-imagery/rgd_imagery/serializers/__init__.py | Kitware/ResonantGeoData | 6d111cbe1d57df2cd230edcf4724f6e33471f5ff | [
"Apache-2.0"
] | 3 | 2020-03-10T14:47:07.000Z | 2020-05-05T16:55:27.000Z | django-rgd-imagery/rgd_imagery/serializers/__init__.py | Kitware/ResonantGeoData | 6d111cbe1d57df2cd230edcf4724f6e33471f5ff | [
"Apache-2.0"
] | 13 | 2020-04-14T14:36:06.000Z | 2020-05-07T15:03:42.000Z | django-rgd-imagery/rgd_imagery/serializers/__init__.py | Kitware/ResonantGeoData | 6d111cbe1d57df2cd230edcf4724f6e33471f5ff | [
"Apache-2.0"
] | 1 | 2020-03-03T15:47:52.000Z | 2020-03-03T15:47:52.000Z | from .base import (
ImageMetaSerializer,
ImageSerializer,
ImageSetSerializer,
ImageSetSpatialSerializer,
)
from .processed import ProcessedImageGroupSerializer, ProcessedImageSerializer
from .raster import RasterMetaSerializer, RasterSerializer
__all__ = [
'ImageSerializer',
'ImageMetaSerializer',
'ImageSetSerializer',
'ImageSetSpatialSerializer',
'ProcessedImageGroupSerializer',
'ProcessedImageSerializer',
'RasterMetaSerializer',
'RasterSerializer',
'RegionImageSerializer',
]
| 25.47619 | 78 | 0.764486 | 27 | 535 | 15 | 0.555556 | 0.212346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158879 | 535 | 20 | 79 | 26.75 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0.349533 | 0.185047 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.157895 | 0 | 0.157895 | 0 | 1 | 0 | 1 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40c084a02dfa33e4f87ca936849135d57916848a | 150 | py | Python | raspagem/random/exemplo02.py | sslppractice/propython | fa470c3bf0dcfbb26037146d77c7491596cabb26 | [
"MIT"
] | null | null | null | raspagem/random/exemplo02.py | sslppractice/propython | fa470c3bf0dcfbb26037146d77c7491596cabb26 | [
"MIT"
] | null | null | null | raspagem/random/exemplo02.py | sslppractice/propython | fa470c3bf0dcfbb26037146d77c7491596cabb26 | [
"MIT"
] | null | null | null | from requests import get
from bs4 import BeautifulSoup
url = 'http://www.ifce.edu.br'
page = requests.get(url)
texto = page.content.decode('utf-8')
| 18.75 | 36 | 0.733333 | 24 | 150 | 4.583333 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015267 | 0.126667 | 150 | 7 | 37 | 21.428571 | 0.824427 | 0 | 0 | 0 | 0 | 0 | 0.18 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
40d7d613ed8c0607f2eb5eeeae10addbd852ee79 | 113 | py | Python | Text Proccessing/substring.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | Text Proccessing/substring.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | Text Proccessing/substring.py | DiyanKalaydzhiev23/fundamentals---python | 7fa032d9a3270648ffa383bb00dad8e51613189d | [
"MIT"
] | null | null | null | to_remove = input()
word = input()
while to_remove in word:
word = word.replace(to_remove, '')
print(word)
| 14.125 | 38 | 0.672566 | 17 | 113 | 4.294118 | 0.470588 | 0.328767 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185841 | 113 | 7 | 39 | 16.142857 | 0.793478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.2 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40ebec31594607059ed779b66dc8d6e55e8b9128 | 2,202 | py | Python | src/abaqus/Connector/ConnectorStop.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/Connector/ConnectorStop.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/Connector/ConnectorStop.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from .ConnectorBehaviorOption import ConnectorBehaviorOption
class ConnectorStop(ConnectorBehaviorOption):
"""The ConnectorStop object defines connector stops for one or more components of a
connector's relative motion.
The ConnectorStop object is derived from the ConnectorBehaviorOption object.
Notes
-----
This object can be accessed by:
.. code-block:: python
import section
mdb.models[name].sections[name].behaviorOptions[i]
import odbSection
session.odbs[name].sections[name].behaviorOptions[i]
The corresponding analysis keywords are:
- CONNECTOR STOP
"""
def __init__(self, minMotion: float = None, maxMotion: float = None, components: tuple = ()):
"""This method creates a connector stop behavior option for a ConnectorSection object.
Notes
-----
This function can be accessed by:
.. code-block:: python
import connectorBehavior
connectorBehavior.ConnectorStop
import odbConnectorBehavior
odbConnectorBehavior.ConnectorStop
Parameters
----------
minMotion
None or a Float specifying the lower bound for the connector's relative position for all
specified components, or no lower bound. The default value is None.
maxMotion
None or a Float specifying the upper bound for the connector's relative position for all
specified components, or no upper bound. The default value is None.
components
A sequence of Ints specifying the components of relative motion for which the behavior
is defined. Possible values are 1 ≤≤ *components* ≤≤ 6. Only available components can be
specified. The default value is an empty sequence.
Returns
-------
A ConnectorStop object.
Raises
------
ValueError and TextError.
"""
super().__init__()
pass
def setValues(self):
"""This method modifies the ConnectorStop object.
Raises
------
ValueError.
"""
pass
| 30.583333 | 101 | 0.625795 | 227 | 2,202 | 6.052863 | 0.418502 | 0.055313 | 0.048035 | 0.037118 | 0.269287 | 0.222707 | 0.148472 | 0.148472 | 0.09607 | 0.09607 | 0 | 0.001315 | 0.309264 | 2,202 | 71 | 102 | 31.014085 | 0.899408 | 0.709809 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
40eef1cd77552938b0e5bfd59e84c1ca988af2dc | 3,651 | py | Python | pytorch_lightning/core/__init__.py | skepticleo/pytorch-lightning | 6a39573267e4757c7443a519a48037a6e91da3b3 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/core/__init__.py | skepticleo/pytorch-lightning | 6a39573267e4757c7443a519a48037a6e91da3b3 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/core/__init__.py | skepticleo/pytorch-lightning | 6a39573267e4757c7443a519a48037a6e91da3b3 | [
"Apache-2.0"
] | 1 | 2020-03-02T11:53:08.000Z | 2020-03-02T11:53:08.000Z | """
A LightningModule is a strict superclass of torch.nn.Module but provides an interface to standardize
the "ingredients" for a research or production system.
- The model/system definition (__init__)
- The model/system computations (forward)
- What happens in the training loop (training_step, training_end)
- What happens in the validation loop (validation_step, validation_end)
- What happens in the test loop (test_step, test_end)
- What optimizers to use (configure_optimizers)
- What data to use (train_dataloader, val_dataloader, test_dataloader)
Most methods are optional. Here's a minimal example.
.. code-block:: python
import os
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torchvision.datasets import MNIST
import torchvision.transforms as transforms
import pytorch_lightning as pl
class CoolModel(pl.LightningModule):
def __init__(self):
super(CoolModel, self).__init__()
self.l1 = torch.nn.Linear(28 * 28, 10)
def forward(self, x):
return torch.relu(self.l1(x.view(x.size(0), -1)))
def training_step(self, batch, batch_idx):
x, y = batch
y_hat = self.forward(x)
return {'loss': F.cross_entropy(y_hat, y)}
def configure_optimizers(self):
return torch.optim.Adam(self.parameters(), lr=0.02)
def train_dataloader(self):
return DataLoader(MNIST(os.getcwd(), train=True, download=True,
transform=transforms.ToTensor()), batch_size=32)
Which you can train by doing:
.. code-block:: python
trainer = pl.Trainer()
model = CoolModel()
trainer.fit(model)
If you wanted to add a validation loop
.. code-block:: python
class CoolModel(pl.LightningModule):
def validation_step(self, batch, batch_idx):
x, y = batch
y_hat = self.forward(x)
return {'val_loss': F.cross_entropy(y_hat, y)}
def validation_end(self, outputs):
val_loss_mean = torch.stack([x['val_loss'] for x in outputs]).mean()
return {'val_loss': val_loss_mean}
def val_dataloader(self):
# can also return a list of val dataloaders
return DataLoader(MNIST(os.getcwd(), train=True, download=True,
transform=transforms.ToTensor()), batch_size=32)
Or add a test loop
.. code_block:: python
class CoolModel(pl.LightningModule):
def test_step(self, batch, batch_idx):
x, y = batch
y_hat = self.forward(x)
return {'test_loss': F.cross_entropy(y_hat, y)}
def test_end(self, outputs):
test_loss_mean = torch.stack([x['test_loss'] for x in outputs]).mean()
return {'test_loss': test_loss_mean}
def test_dataloader(self):
# OPTIONAL
# can also return a list of test dataloaders
return DataLoader(MNIST(os.getcwd(), train=False, download=True,
transform=transforms.ToTensor()), batch_size=32)
Check out this
`COLAB <https://colab.research.google.com/drive/1F_RNcHzTfFuQf-LeKvSlud6x7jXYkG31#scrollTo=HOk9c4_35FKg>`_
for a live demo.
.. note:: Remove all .cuda() or .to() calls from LightningModules. See:
`the multi-gpu training guide for details <multi_gpu.rst>`_.
"""
from .decorators import data_loader
from .lightning import LightningModule
__all__ = ['LightningModule', 'data_loader']
# __call__ = __all__
| 33.190909 | 106 | 0.63736 | 463 | 3,651 | 4.850972 | 0.323974 | 0.010686 | 0.026714 | 0.021371 | 0.363758 | 0.314782 | 0.296972 | 0.247996 | 0.192342 | 0.145147 | 0 | 0.010444 | 0.265681 | 3,651 | 109 | 107 | 33.495413 | 0.827303 | 0.963572 | 0 | 0 | 0 | 0 | 0.209677 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
40f3e825b8dac6a3d6c7a8a7da8213714fd11da5 | 140 | py | Python | ghost_chat/settings/dev.py | durandj/ghost-chat | 85e454c9bb72c3b65ae8e23a4d4bd2c836398a51 | [
"MIT"
] | null | null | null | ghost_chat/settings/dev.py | durandj/ghost-chat | 85e454c9bb72c3b65ae8e23a4d4bd2c836398a51 | [
"MIT"
] | null | null | null | ghost_chat/settings/dev.py | durandj/ghost-chat | 85e454c9bb72c3b65ae8e23a4d4bd2c836398a51 | [
"MIT"
] | null | null | null | # pylint: disable=unused-wildcard-import, wildcard-import
from .base import *
DEBUG = True
TEMPLATE_DEBUG = True
STATIC_ROOT = 'static'
| 14 | 57 | 0.75 | 18 | 140 | 5.722222 | 0.666667 | 0.271845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 140 | 9 | 58 | 15.555556 | 0.865546 | 0.392857 | 0 | 0 | 0 | 0 | 0.073171 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
40fb0dc15dddbda0dd962d986e2aea8e819c38c0 | 844 | py | Python | users/admin.py | katieefrey/Bib_Search | de86e33e5e2d44fd974f10d2efd41377eb5d8c8f | [
"MIT"
] | null | null | null | users/admin.py | katieefrey/Bib_Search | de86e33e5e2d44fd974f10d2efd41377eb5d8c8f | [
"MIT"
] | 6 | 2020-06-15T20:20:16.000Z | 2021-09-22T18:50:23.000Z | users/admin.py | katieefrey/Bib_Search | de86e33e5e2d44fd974f10d2efd41377eb5d8c8f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Group
from .forms import CustomUserCreationForm, CustomUserChangeForm
from .models import CustomUser, Bibgroup
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model = CustomUser
list_display = ['username', 'email', 'bibgroup']
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name', 'devkey','bibgroup')}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions')})
)
admin.site.register(CustomUser, CustomUserAdmin)
admin.site.register(Bibgroup)
admin.site.unregister(Group) | 36.695652 | 108 | 0.725118 | 90 | 844 | 6.688889 | 0.488889 | 0.066445 | 0.112957 | 0.104651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14218 | 844 | 23 | 109 | 36.695652 | 0.831492 | 0 | 0 | 0 | 0 | 0 | 0.189349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.052632 | 0.315789 | 0 | 0.631579 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
dc050d606c89cf7963f08005824d3bb5ee228d2d | 145 | py | Python | profiles_api/urls.py | frikinomad/rishi-profiles-rest-api | c19b41acdd164deac40b178390533096f0316a2f | [
"MIT"
] | null | null | null | profiles_api/urls.py | frikinomad/rishi-profiles-rest-api | c19b41acdd164deac40b178390533096f0316a2f | [
"MIT"
] | null | null | null | profiles_api/urls.py | frikinomad/rishi-profiles-rest-api | c19b41acdd164deac40b178390533096f0316a2f | [
"MIT"
] | null | null | null | from django.urls import path
from .views import HelloApiView
urlpatterns = [
path('hello-view/', HelloApiView.as_view(), name="apiview"),
]
| 20.714286 | 64 | 0.724138 | 18 | 145 | 5.777778 | 0.722222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 145 | 6 | 65 | 24.166667 | 0.832 | 0 | 0 | 0 | 0 | 0 | 0.124138 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
dc1334a054d7565d6f701792ee27060d4fa6aac2 | 1,603 | py | Python | src/deepcv/meta/data/viz.py | PaulEmmanuelSotir/DeepCV | 4c0ed68d47dceb713d7f34ca258dad957bcd3611 | [
"MIT"
] | 6 | 2020-04-05T13:12:02.000Z | 2022-03-13T06:27:55.000Z | src/deepcv/meta/data/viz.py | PaulEmmanuelSotir/DeepCV | 4c0ed68d47dceb713d7f34ca258dad957bcd3611 | [
"MIT"
] | null | null | null | src/deepcv/meta/data/viz.py | PaulEmmanuelSotir/DeepCV | 4c0ed68d47dceb713d7f34ca258dad957bcd3611 | [
"MIT"
] | 2 | 2020-04-19T21:10:26.000Z | 2021-04-23T22:19:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Data visualization meta module - viz.py - `DeepCV`__
.. moduleauthor:: Paul-Emmanuel Sotir
"""
import collections
from pathlib import Path
from types import ModuleType
from typing import Optional, Union, Tuple
import numpy as np
import matplotlib
import torch
from PIL import Image
import deepcv.utils
__all__ = ['plot', 'sample_tumbails', 'plot_tumbails']
__author__ = 'Paul-Emmanuel Sotir'
def plot(backend: ModuleType = matplotlib, show_in_tensorboard: bool = False, **plot_kwargs):
raise NotImplementedError
# if backend is matplotlib:
# img = matplotlib.plot(**plot_kwargs)
# elif backend is seaborn:
# img = seaborn.plot(**plot_kwargs)
# elif backend is altair:
# img = altair.plot(**plot_kwargs)
# else:
# raise ValueError(f'Error: Unrecognized plotting backend: "{backend}"')
if show_in_tensorboard:
raise NotImplementedError
def sample_tumbails(datatset, image_count: int = 64, tumbail_size: Tuple[int, int] = (32, 32)):
with datatset.threadlocal_shuffle():
for image, _taget in datatset[:image_count]:
tumb = image.thumbnail(tumbail_size)
raise NotImplementedError # TODO: aggregate tumbails into one PIL Image
def plot_tumbails(tumbails):
raise NotImplementedError
# TODO: generate (or at least simplify generation) architectecture diagram by feeding pytorch computation graph into http://alexlenail.me/NN-SVG/index.html
if __name__ == '__main__':
cli = deepcv.utils.import_tests().test_module_cli(__file__)
cli()
| 29.145455 | 155 | 0.712414 | 196 | 1,603 | 5.607143 | 0.55102 | 0.036397 | 0.038217 | 0.032757 | 0.049136 | 0.049136 | 0 | 0 | 0 | 0 | 0 | 0.005376 | 0.187773 | 1,603 | 54 | 156 | 29.685185 | 0.83871 | 0.37617 | 0 | 0.16 | 0 | 0 | 0.060143 | 0 | 0 | 0 | 0 | 0.018519 | 0 | 1 | 0.12 | false | 0 | 0.4 | 0 | 0.52 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
dc178b0e2a80bc75dd297b43da78e1af8c84cb65 | 409 | py | Python | property_mapper/exceptions.py | Yuego/python-property-mapper | c36f19829e57eb802bbe461cc4fb8d4ac4640201 | [
"MIT"
] | null | null | null | property_mapper/exceptions.py | Yuego/python-property-mapper | c36f19829e57eb802bbe461cc4fb8d4ac4640201 | [
"MIT"
] | null | null | null | property_mapper/exceptions.py | Yuego/python-property-mapper | c36f19829e57eb802bbe461cc4fb8d4ac4640201 | [
"MIT"
] | null | null | null | class PropertyMapperException(Exception):
pass
class UnsupportedType(PropertyMapperException):
pass
class WrongType(PropertyMapperException):
pass
class OverrideForbidden(PropertyMapperException):
pass
class ValidationError(Exception):
"""
Ошибка при заполнении данных маппера.
Либо присутствуют неизвестные параметры,
либо не заполнены все известные.
"""
pass
| 17.041667 | 49 | 0.748166 | 34 | 409 | 9 | 0.617647 | 0.117647 | 0.313725 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.193154 | 409 | 23 | 50 | 17.782609 | 0.927273 | 0.271394 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
908afe0e979a5b3af75eced742db413c36e166a7 | 756 | py | Python | app/queries.py | cobanov/demc-homework | 82b45da016b80055a39afb22dde5d32653abf26e | [
"MIT"
] | 2 | 2021-03-06T22:01:27.000Z | 2021-03-08T18:18:26.000Z | app/queries.py | cobanov/demc-homework | 82b45da016b80055a39afb22dde5d32653abf26e | [
"MIT"
] | null | null | null | app/queries.py | cobanov/demc-homework | 82b45da016b80055a39afb22dde5d32653abf26e | [
"MIT"
] | null | null | null | top_avg = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY averageRating
DESC
LIMIT 5
"""
worst_avg = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY averageRating
ASC
LIMIT 5
"""
top_vote = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY numVotes
DESC
LIMIT 5
"""
worst_vote = """SELECT *
FROM rm_episodes
INNER JOIN ratings
ON rm_episodes.tconst = ratings.tconst
ORDER BY numVotes
ASC
LIMIT 5
"""
seven_b = """SELECT *
FROM name_basics
WHERE birthYear > 2000
AND primaryProfession
LIKE '%music_department%'
AND primaryProfession
LIKE '%actress%' """
seven_c = """select count(*) from four_actress """
| 16.8 | 50 | 0.752646 | 109 | 756 | 5.06422 | 0.33945 | 0.144928 | 0.086957 | 0.144928 | 0.637681 | 0.637681 | 0.637681 | 0.637681 | 0.637681 | 0.637681 | 0 | 0.0125 | 0.153439 | 756 | 44 | 51 | 17.181818 | 0.85 | 0 | 0 | 0.75 | 0 | 0 | 0.851852 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
90a044b2dfe785dce5320b78916acbed818a6c87 | 1,034 | py | Python | python/msc/entry/q13.py | gerritjvv/optimization_algorithms | eab2e8fff39eeab8d9be45af3dae3be1a62be3ba | [
"MIT"
] | null | null | null | python/msc/entry/q13.py | gerritjvv/optimization_algorithms | eab2e8fff39eeab8d9be45af3dae3be1a62be3ba | [
"MIT"
] | null | null | null | python/msc/entry/q13.py | gerritjvv/optimization_algorithms | eab2e8fff39eeab8d9be45af3dae3be1a62be3ba | [
"MIT"
] | null | null | null | # Q13
import numpy as np
import matplotlib.pyplot as plt
def f_x(a):
def f(t):
return a * np.cos(t) ** 3
return f
def f_dx(a):
def f(t):
return a * -3 * np.sin(t) * (np.cos(t) ** 2)
return f
def f_y(a):
def f(t):
return a * np.sin(t) ** 3
return f
def f_dy(a):
def f(t):
return a * 3 * (np.sin(t) ** 2) * (np.cos(t))
return f
def f_integrand(a):
y_dy = f_dy(a);
x_dx = f_dx(a);
def f(t):
return np.sqrt(x_dx(t) ** 2 + y_dy(t) ** 2)
return f
def mc_integrate(f, a, b, n=1000000):
# Monte Carlo
vals = np.random.uniform(a, b, n)
y = np.vectorize(f)(vals)
y_mean = np.sum(y) / n
integ = (b - a) * y_mean
return integ
x = np.linspace(0, np.pi * 2)
y = np.vectorize(f_integrand(1))(x)
plt.plot(x, y)
plt.show()
mc_area = mc_integrate(f_integrand(1), 0, np.pi * 2)
print(f"MC Area: {mc_area}")
# 2 * np.sqrt(3) => 3.4641016151377544
# 3 * np.sqrt(3) => 5.196152422706632
# area is 6.0030577246980386
| 14.771429 | 53 | 0.541586 | 196 | 1,034 | 2.760204 | 0.260204 | 0.073937 | 0.046211 | 0.055453 | 0.253235 | 0.208872 | 0.162662 | 0.073937 | 0.073937 | 0.073937 | 0 | 0.104054 | 0.284333 | 1,034 | 69 | 54 | 14.985507 | 0.627027 | 0.111219 | 0 | 0.277778 | 0 | 0 | 0.019737 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.305556 | false | 0 | 0.055556 | 0.138889 | 0.666667 | 0.027778 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
90ad26f0f396ecf4777e888f0d85b3ac1a5daf97 | 450 | py | Python | src/waldur_jira/migrations/0009_drop_old_fields.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | 2 | 2017-01-20T15:26:25.000Z | 2017-08-03T04:38:08.000Z | src/waldur_jira/migrations/0009_drop_old_fields.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | src/waldur_jira/migrations/0009_drop_old_fields.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | # Generated by Django 1.11.7 on 2018-01-03 13:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('waldur_jira', '0008_unique_props'),
]
operations = [
migrations.RemoveField(
model_name='project',
name='available_for_all',
),
migrations.RemoveField(
model_name='project',
name='reporter_field',
),
]
| 21.428571 | 48 | 0.58 | 45 | 450 | 5.622222 | 0.755556 | 0.166008 | 0.205534 | 0.237154 | 0.324111 | 0.324111 | 0 | 0 | 0 | 0 | 0 | 0.064516 | 0.311111 | 450 | 20 | 49 | 22.5 | 0.751613 | 0.102222 | 0 | 0.4 | 1 | 0 | 0.181592 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.066667 | 0 | 0.266667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
90c8d1852ef07e4d75839a13264533ede2b67f0e | 1,401 | py | Python | tests/lib/test_py3compat.py | guyongqiangx/construct | 72c80035f703d29b1dc62a3e08831d68b29a6e40 | [
"MIT"
] | null | null | null | tests/lib/test_py3compat.py | guyongqiangx/construct | 72c80035f703d29b1dc62a3e08831d68b29a6e40 | [
"MIT"
] | 1 | 2021-04-16T12:55:44.000Z | 2021-04-16T12:58:14.000Z | tests/lib/test_py3compat.py | guyongqiangx/construct | 72c80035f703d29b1dc62a3e08831d68b29a6e40 | [
"MIT"
] | 1 | 2021-04-16T12:53:35.000Z | 2021-04-16T12:53:35.000Z | from declarativeunittest import *
from construct.lib.py3compat import *
def test_version():
assert PY2 or PY3
def test_int_byte():
assert int2byte(5) == b"\x05"
assert int2byte(255) == b"\xff"
assert byte2int(b"\x05") == 5
assert byte2int(b"\xff") == 255
assert all(byte2int(int2byte(i)) == i for i in range(256))
def test_str_bytes():
assert str2bytes("abc") == b"abc"
assert bytes2str(b"abc") == "abc"
assert bytes2str(str2bytes("abc123\n")) == "abc123\n"
assert str2bytes(bytes2str(b"abc123\n")) == b"abc123\n"
def test_str_unicode():
assert str2unicode("abc") == u"abc"
assert unicode2str(u"abc") == "abc"
assert unicode2str(str2unicode("abc123\n")) == "abc123\n"
assert str2unicode(unicode2str(u"abc123\n")) == "abc123\n"
def test_iteratebytes():
assert list(iteratebytes(b"abc")) == [b"a", b"b", b"c"]
assert all(list(iteratebytes(int2byte(i))) == [int2byte(i)] for i in range(256))
def test_iterateints():
assert list(iterateints(b"abc")) == [97,98,99]
assert all(list(iterateints(int2byte(i))) == [i] for i in range(256))
def test_bytes():
assert bytes() == b''
assert bytes(2) == b'\x00\x00'
assert bytes([1,2]) == b'\x01\x02'
def test_bytes_integers():
assert bytes2integers(b'abc')[0] == 97
assert list(bytes2integers(b'abc')) == [97,98,99]
assert integers2bytes([97,98,99]) == b'abc'
| 31.840909 | 84 | 0.643112 | 203 | 1,401 | 4.37931 | 0.275862 | 0.062992 | 0.016873 | 0.023622 | 0.175478 | 0.130484 | 0.094488 | 0.094488 | 0.069741 | 0.069741 | 0 | 0.089501 | 0.170592 | 1,401 | 43 | 85 | 32.581395 | 0.675559 | 0 | 0 | 0 | 0 | 0 | 0.098501 | 0 | 0 | 0 | 0 | 0 | 0.705882 | 1 | 0.235294 | true | 0 | 0.058824 | 0 | 0.294118 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
90d59177b3a6aa74a665abead34cadee970b3224 | 255 | py | Python | doepy/models/discrete_time/__init__.py | scwolof/doepy | acb2cad95428de2c14b28563cff1aa30679e1f39 | [
"MIT"
] | 1 | 2020-04-23T13:43:35.000Z | 2020-04-23T13:43:35.000Z | doepy/models/discrete_time/__init__.py | scwolof/doepy | acb2cad95428de2c14b28563cff1aa30679e1f39 | [
"MIT"
] | null | null | null | doepy/models/discrete_time/__init__.py | scwolof/doepy | acb2cad95428de2c14b28563cff1aa30679e1f39 | [
"MIT"
] | 1 | 2021-06-13T14:38:32.000Z | 2021-06-13T14:38:32.000Z | from .model import dtModel
from .linearmodel import dtLinearModel
try:
import GPy
except:
import warnings
warnings.warn("Could not import GPy - cannot import GP models")
else:
from .gpmodel import dtGPModel
from .sparsegpmodel import dtSparseGPModel | 23.181818 | 64 | 0.803922 | 33 | 255 | 6.212121 | 0.636364 | 0.087805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145098 | 255 | 11 | 65 | 23.181818 | 0.940367 | 0 | 0 | 0 | 0 | 0 | 0.179688 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.7 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
90e047548402bbf0cf9867168c0fbdd3d1ed1c02 | 214 | py | Python | pyplan/pyplan/modelmanager/classes/copyAsValuesParam.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 17 | 2019-12-04T19:22:19.000Z | 2021-07-28T11:17:05.000Z | pyplan/pyplan/modelmanager/classes/copyAsValuesParam.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 9 | 2019-12-13T15:34:43.000Z | 2022-02-10T11:43:00.000Z | pyplan/pyplan/modelmanager/classes/copyAsValuesParam.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | 5 | 2019-12-04T15:57:06.000Z | 2021-08-20T19:59:26.000Z | class CopyAsValuesParam(object):
def __init__(self, **kargs):
self.nodeId = kargs["nodeId"] if "nodeId" in kargs else None
self.asNewNode = kargs["asNewNode"] if "asNewNode" in kargs else False
| 42.8 | 78 | 0.682243 | 27 | 214 | 5.259259 | 0.518519 | 0.098592 | 0.15493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200935 | 214 | 4 | 79 | 53.5 | 0.830409 | 0 | 0 | 0 | 0 | 0 | 0.140187 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
90efb0b851bf6fb283689a9f36581e1e22a43383 | 170 | py | Python | fs_image/buck/tests/coverage_test_helper.py | snarkmaster/buckit | bc1a176385226ccae1e518c4c9306f7af131b053 | [
"BSD-3-Clause"
] | null | null | null | fs_image/buck/tests/coverage_test_helper.py | snarkmaster/buckit | bc1a176385226ccae1e518c4c9306f7af131b053 | [
"BSD-3-Clause"
] | null | null | null | fs_image/buck/tests/coverage_test_helper.py | snarkmaster/buckit | bc1a176385226ccae1e518c4c9306f7af131b053 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
def coverage_test_helper():
one = 10 + 3 - 12
print('This function should be called {one} time to achieve 100% coverage')
return one
| 21.25 | 79 | 0.670588 | 26 | 170 | 4.307692 | 0.884615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068182 | 0.223529 | 170 | 7 | 80 | 24.285714 | 0.780303 | 0.123529 | 0 | 0 | 0 | 0 | 0.445946 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
290b55516be186677e95b8a6050c716bf46538b2 | 837 | py | Python | maro/utils/exception/base_exception.py | yangboz/maro | 0973783e55ca07bf8e177910c9d47854117a4ea8 | [
"MIT"
] | 598 | 2020-09-23T00:50:22.000Z | 2022-03-31T08:12:54.000Z | maro/utils/exception/base_exception.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 235 | 2020-09-22T10:20:48.000Z | 2022-03-31T02:10:03.000Z | maro/utils/exception/base_exception.py | gx9702/maro | 38c796f0a7ed1e0f64c299d96c6e0df032401fa9 | [
"MIT"
] | 116 | 2020-09-22T09:19:04.000Z | 2022-02-12T05:04:07.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from .error_code import ERROR_CODE
class MAROException(Exception):
"""The base exception class for MARO.
Args:
error_code (int): the predefined MARO error code. You can find the
detailed definition in: `maro.utils.exception.error_code.py`.
msg (str): Description of the error. Defaults to None, which will
show the base error information.
"""
def __init__(self, error_code: int = 1000, msg: str = None):
self.error_code = error_code
self.strerror = msg if msg else ERROR_CODE[self.error_code]
def __str__(self):
return self.strerror if isinstance(self.strerror, str) else str(self.strerror)
def __repr__(self):
return f"{self.__class__.__name__}({str(self)})"
| 31 | 86 | 0.676225 | 113 | 837 | 4.752212 | 0.469027 | 0.167598 | 0.072626 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006211 | 0.230585 | 837 | 26 | 87 | 32.192308 | 0.82764 | 0.433692 | 0 | 0 | 0 | 0 | 0.085973 | 0.085973 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0.222222 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
290c27bb1288e36c665ab5fa6eec97965c5da02f | 216 | py | Python | python/testData/inspections/PyUnresolvedReferencesInspection/innerClassAsNamedTupleDefinitionMember.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2018-12-29T09:53:39.000Z | 2018-12-29T09:53:42.000Z | python/testData/inspections/PyUnresolvedReferencesInspection/innerClassAsNamedTupleDefinitionMember.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/PyUnresolvedReferencesInspection/innerClassAsNamedTupleDefinitionMember.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from typing import NamedTuple
class User(NamedTuple):
class PrivLvl:
ADMIN = 1
OPERATOR = 2
name: str
level: PrivLvl = PrivLvl.ADMIN
User.PrivLvl
admin = User('MrRobot')
admin.PrivLvl | 14.4 | 34 | 0.657407 | 26 | 216 | 5.461538 | 0.576923 | 0.253521 | 0.225352 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012579 | 0.263889 | 216 | 15 | 35 | 14.4 | 0.880503 | 0 | 0 | 0 | 0 | 0 | 0.032258 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2920b37b883055b365215e546c8065c1dc041e24 | 213 | py | Python | src/lab_text_processing/nltk.py | labhackercd/lab-text-processing | 9508dde2c8fc5fa8af41d1496e63f2c23944db11 | [
"MIT"
] | null | null | null | src/lab_text_processing/nltk.py | labhackercd/lab-text-processing | 9508dde2c8fc5fa8af41d1496e63f2c23944db11 | [
"MIT"
] | null | null | null | src/lab_text_processing/nltk.py | labhackercd/lab-text-processing | 9508dde2c8fc5fa8af41d1496e63f2c23944db11 | [
"MIT"
] | null | null | null | import nltk
def download_modules():
nltk.download('floresta')
nltk.download('mac_morpho')
nltk.download('machado')
nltk.download('rslp')
nltk.download('punkt')
nltk.download('stopwords')
| 19.363636 | 31 | 0.676056 | 24 | 213 | 5.916667 | 0.5 | 0.507042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169014 | 213 | 10 | 32 | 21.3 | 0.80226 | 0 | 0 | 0 | 0 | 0 | 0.201878 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0 | 0.125 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
292e5cbf0a02f76341f6aae5091d112c08b2124b | 155 | py | Python | test/CC/gcc-non-utf8-fixture/gcc-non-utf8.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | 1 | 2021-12-31T16:46:10.000Z | 2021-12-31T16:46:10.000Z | test/CC/gcc-non-utf8-fixture/gcc-non-utf8.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | null | null | null | test/CC/gcc-non-utf8-fixture/gcc-non-utf8.py | jcassagnol-public/scons | 8eaf585a893757e68c9e4a6e25d375021fa5eab7 | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
if '--version' in sys.argv:
with open("data", "rb") as f:
sys.stdout.buffer.write(f.read())
| 22.142857 | 45 | 0.56129 | 22 | 155 | 3.590909 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.264516 | 155 | 6 | 46 | 25.833333 | 0.692982 | 0 | 0 | 0 | 0 | 0 | 0.148387 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
29394931074cc5bbdb7255495b026b2c1efbfb6c | 112 | py | Python | ldap_backend/__init__.py | haginara/django-ldap-backend | 3770746c0e7f7bacce61ba0687c01e73228d6e4d | [
"MIT"
] | null | null | null | ldap_backend/__init__.py | haginara/django-ldap-backend | 3770746c0e7f7bacce61ba0687c01e73228d6e4d | [
"MIT"
] | null | null | null | ldap_backend/__init__.py | haginara/django-ldap-backend | 3770746c0e7f7bacce61ba0687c01e73228d6e4d | [
"MIT"
] | null | null | null | name = "django_ldap_backend"
__version_info__ = (0, 9, 1)
__version__ = ".".join(map(str, __version_info__))
| 28 | 51 | 0.705357 | 15 | 112 | 4.2 | 0.8 | 0.349206 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030928 | 0.133929 | 112 | 3 | 52 | 37.333333 | 0.618557 | 0 | 0 | 0 | 0 | 0 | 0.183486 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2985e862a3191ddcf6431185046c11c79eb7fd1d | 261 | py | Python | Modulo 3/090.py | thiago19maciel/Exercicios-em-Python | 0d46816caf655c6e870510bb1136964854fc875f | [
"MIT"
] | 1 | 2022-03-22T22:36:48.000Z | 2022-03-22T22:36:48.000Z | Modulo 3/090.py | thiago19maciel/Exercicios-em-Python | 0d46816caf655c6e870510bb1136964854fc875f | [
"MIT"
] | null | null | null | Modulo 3/090.py | thiago19maciel/Exercicios-em-Python | 0d46816caf655c6e870510bb1136964854fc875f | [
"MIT"
] | null | null | null | dados_aluno = {'Nome': str(input('Nome do aluno: ')), 'Media': float(input('Média: '))}
if dados_aluno['Media'] > 7:
dados_aluno['situação'] = 'Aprovado'
else:
dados_aluno['situação'] = 'Reprovado'
print(f'Situação é igual a {dados_aluno["situação"]} ') | 43.5 | 87 | 0.659004 | 35 | 261 | 4.771429 | 0.571429 | 0.299401 | 0.323353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004405 | 0.130268 | 261 | 6 | 88 | 43.5 | 0.731278 | 0 | 0 | 0 | 0 | 0 | 0.435115 | 0.09542 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.166667 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
462a8ac3eeb0319c2c16777e3541aaff3ad6cc09 | 6,417 | py | Python | lyteflow/kernels/filter.py | MammothStack/Lyteflow | 63a60f593b954f8a224fcd4864fe6af82d20dd91 | [
"MIT"
] | 1 | 2021-08-25T02:43:19.000Z | 2021-08-25T02:43:19.000Z | lyteflow/kernels/filter.py | MammothStack/Lyteflow | 63a60f593b954f8a224fcd4864fe6af82d20dd91 | [
"MIT"
] | null | null | null | lyteflow/kernels/filter.py | MammothStack/Lyteflow | 63a60f593b954f8a224fcd4864fe6af82d20dd91 | [
"MIT"
] | null | null | null | """All kernels that are involved with filtering their inputs
This module contains kernels that filter by columns or by index, as well as column and
index renaming
"""
# Standard library imports
import warnings
# Third party imports
import numpy as np
import pandas as pd
# Local application imports
from lyteflow.kernels.base import PipeElement
class ColumnFilter(PipeElement):
"""A filter applied to columns selecting only the given columns of the DataFrame
This is a subclass of PipeElement and therefore inherits all of its functions
except for the transform function, which is overridden.
Methods
------------------
transform(x)
Filters the columns on the given DataFrame
"""
def __init__(self, columns, ignore_absent=False, **kwargs):
"""Constructor
Arguments
------------------
columns : list
A list of columns that should be filtered for
ignore_absent : bool
If columns which are not found in the given columns should be ignored or
should throw an error
"""
PipeElement.__init__(self, **kwargs)
self.columns = columns
self.ignore_absent = ignore_absent
def transform(self, x):
"""Filters the DataFrame for the given columns
Arguments
------------------
x : pd.DataFrame
The DataFrame that should be filtered
Returns
------------------
x : pd.DataFrame
Filtered DataFrame
Raises
------------------
KeyError
When the ignore_absent is False and the set columns is not found in the given
DataFrame
"""
found_columns = x.columns.intersection(self.columns)
if len(found_columns) != len(self.columns) and not self.ignore_absent:
raise KeyError(
f"{set(self.columns).difference(x.columns)} not found in the DataFrame"
)
else:
return x.loc[:, found_columns]
class IndexFilter(PipeElement):
"""A filter applied to index selecting only the given index of the DataFrame
This is a subclass of PipeElement and therefore inherits all of its functions
except for the transform function, which is overridden.
Methods
------------------
transform(x)
Filters the index on the given DataFrame
"""
def __init__(self, index, ignore_absent=False, **kwargs):
"""Constructor
Arguments
------------------
index : list
A list of indices that should be filtered for
ignore_absent : bool
If indices which are not found in the given index should be ignored or
should throw an error
"""
PipeElement.__init__(self, **kwargs)
self.index = index
self.ignore_absent = ignore_absent
def transform(self, x):
"""Filters the DataFrame for the given index
Arguments
------------------
x : pd.DataFrame
The DataFrame that should be filtered
Returns
------------------
x : pd.DataFrame
Filtered DataFrame
Raises
------------------
KeyError
When the ignore_absent is False and the set index is not found in the given
DataFrame
"""
found_indices = x.index.intersection(self.index)
if len(found_indices) != len(self.index) and not self.ignore_absent:
raise KeyError(
f"{set(self.index).difference(x.index)} not found in the DataFrame"
)
else:
return x.loc[found_indices, :]
class Filter(PipeElement):
"""A filter applied to index and columns of the given DataFrame
This is a subclass of PipeElement and therefore inherits all of its functions
except for the transform function, which is overridden.
Methods
------------------
transform(x)
Filters the column and index of the given DataFrame
"""
def __init__(
self,
index=None,
columns=None,
ignore_absent_index=False,
ignore_absent_columns=False,
**kwargs,
):
"""Constructor
Arguments
------------------
index : list
A list of indices that should be filtered for
coluns :list
A list of columns that should be filtered for
ignore_absent_index : bool
If indices which are not found in the given index should be ignored or
should throw an error
ignore_absent_columns : bool
If columns which are not found in the given columns should be ignored or
should throw an error
"""
PipeElement.__init__(self, **kwargs)
self.index = index
self.columns = columns
self.ignore_absent_index = ignore_absent_index
self.ignore_absent_columns = ignore_absent_columns
def transform(self, x):
"""Filters the DataFrame for the given index
Arguments
------------------
x : pd.DataFrame
The DataFrame that should be filtered
Returns
------------------
x : pd.DataFrame
Filtered DataFrame
Raises
------------------
KeyError
When either ignore_absent_index, ignore_absent_columns are true and the
given index or columns are not found, respectively
"""
if self.index is None:
self.index = x.index
else:
found_indices = x.index.intersection(self.index)
if len(found_indices) != len(self.index) and not self.ignore_absent_index:
raise KeyError(
f"{set(self.index).difference(x.index)} not found in the DataFrame"
)
if self.columns is None:
self.columns = x.columns
else:
found_columns = x.columns.intersection(self.columns)
if (
len(found_columns) != len(self.columns)
and not self.ignore_absent_columns
):
raise KeyError(
f"{set(self.columns).difference(x.columns)} not found in the DataFrame"
)
return x.loc[found_indices, found_columns]
| 28.52 | 91 | 0.574412 | 723 | 6,417 | 4.998617 | 0.149378 | 0.07969 | 0.02767 | 0.035971 | 0.785556 | 0.757333 | 0.71223 | 0.685113 | 0.669065 | 0.665744 | 0 | 0 | 0.332087 | 6,417 | 224 | 92 | 28.647321 | 0.84321 | 0.476547 | 0 | 0.461538 | 0 | 0 | 0.10146 | 0.059954 | 0 | 0 | 0 | 0 | 0 | 1 | 0.092308 | false | 0 | 0.061538 | 0 | 0.246154 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
463a3267acaf90806635631292b4b85203367ba1 | 93 | py | Python | abc/abc058/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/abc058/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/abc058/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | a, b, c = map(int, input().split())
if b - a == c - b:
print("YES")
else:
print("NO") | 18.6 | 35 | 0.473118 | 17 | 93 | 2.588235 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258065 | 93 | 5 | 36 | 18.6 | 0.637681 | 0 | 0 | 0 | 0 | 0 | 0.053191 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
466c65e0db2e030be35e12a5447c271c9726486b | 71 | py | Python | bot_constants.py | shadabk96/mm_hack | 4e540aec91c724a6b602c9a5b0f0d4d6d4e5d01c | [
"Apache-2.0"
] | null | null | null | bot_constants.py | shadabk96/mm_hack | 4e540aec91c724a6b602c9a5b0f0d4d6d4e5d01c | [
"Apache-2.0"
] | null | null | null | bot_constants.py | shadabk96/mm_hack | 4e540aec91c724a6b602c9a5b0f0d4d6d4e5d01c | [
"Apache-2.0"
] | null | null | null | SCHEDULED_UPDATE_TIME_INTERVAL = 10
SCHEDULED_UPDATE_NUMBER_OF_DAYS = 1 | 35.5 | 35 | 0.901408 | 11 | 71 | 5.181818 | 0.818182 | 0.526316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045455 | 0.070423 | 71 | 2 | 36 | 35.5 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4674441ba52ba4fdbebe27b7304f823b9619c610 | 456 | py | Python | kuwala/core/backend/app/database/utils/encoder.py | EteimZ/kuwala | d5a6aafa0bf7d0bca1a5dc33da414a386b5ca0b1 | [
"Apache-2.0"
] | null | null | null | kuwala/core/backend/app/database/utils/encoder.py | EteimZ/kuwala | d5a6aafa0bf7d0bca1a5dc33da414a386b5ca0b1 | [
"Apache-2.0"
] | null | null | null | kuwala/core/backend/app/database/utils/encoder.py | EteimZ/kuwala | d5a6aafa0bf7d0bca1a5dc33da414a386b5ca0b1 | [
"Apache-2.0"
] | null | null | null | import json
from fastapi.encoders import jsonable_encoder
def list_props_to_json_props(base_object: dict, list_parameters: [str]) -> dict:
jsonable_object = jsonable_encoder(base_object)
for lp in list_parameters:
jsonable_object[lp] = json.dumps(jsonable_object[lp])
return jsonable_object
def list_of_dicts_to_dict(list_of_dicts: [dict], key: str, value: str):
return dict(map(lambda d: (d[key], d[value]), list_of_dicts))
| 26.823529 | 80 | 0.747807 | 69 | 456 | 4.623188 | 0.405797 | 0.175549 | 0.103448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151316 | 456 | 16 | 81 | 28.5 | 0.824289 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
46777f02fe9d31985c3549f46fe79b8649ceaa37 | 93 | py | Python | NovelBlog/apps.py | Novel-Public-Health/Novel-Public-Health | fbb7dd0da64ae4fc9641097ca8056152129bd83b | [
"CC0-1.0"
] | null | null | null | NovelBlog/apps.py | Novel-Public-Health/Novel-Public-Health | fbb7dd0da64ae4fc9641097ca8056152129bd83b | [
"CC0-1.0"
] | null | null | null | NovelBlog/apps.py | Novel-Public-Health/Novel-Public-Health | fbb7dd0da64ae4fc9641097ca8056152129bd83b | [
"CC0-1.0"
] | null | null | null | from django.apps import AppConfig
class NovelblogConfig(AppConfig):
name = 'NovelBlog'
| 15.5 | 33 | 0.763441 | 10 | 93 | 7.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16129 | 93 | 5 | 34 | 18.6 | 0.910256 | 0 | 0 | 0 | 0 | 0 | 0.096774 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
467b4617b167307f5b0011580e797cb504cf89b1 | 2,052 | py | Python | maga/test/maga_test.py | jobine/smartAI-plugin | b19709315eccf553518fceed1b369be709b113ce | [
"MIT"
] | null | null | null | maga/test/maga_test.py | jobine/smartAI-plugin | b19709315eccf553518fceed1b369be709b113ce | [
"MIT"
] | null | null | null | maga/test/maga_test.py | jobine/smartAI-plugin | b19709315eccf553518fceed1b369be709b113ce | [
"MIT"
] | null | null | null | from requests import Request
from maga.maga_plugin_service import MagaPluginService
from os import environ
import json
if __name__ == '__main__':
environ['SERVICE_CONFIG_FILE'] = 'maga/config/service_config.yaml'
maga_plugin = MagaPluginService()
request = Request()
request.data = r'{"groupId":"8e826a5d-1b01-4ff4-a699-38bea97e17de","seriesSets":[{"seriesSetId":"b643e346-6883-4764-84a5-e63a3788eec9","metricId":"dc5b66cf-6dd0-4c83-bb8f-d849e68a7660","dimensionFilter":{"ts_code":"600030.SH"},"seriesSetName":"Stock price_high","metricMeta":{"granularityName":"Daily","granularityAmount":0,"datafeedId":"29595b1c-531f-445c-adcf-b75b2ab93c34","metricName":"high","datafeedName":"Stock price","dataStartFrom":1105315200000}},{"seriesSetId":"0d4cce4d-f4d4-4cef-be87-dbd28062abfc","metricId":"3274f7e6-683b-4d92-b134-0c1186e416a1","dimensionFilter":{"ts_code":"600030.SH"},"seriesSetName":"Stock price_change","metricMeta":{"granularityName":"Daily","granularityAmount":0,"datafeedId":"29595b1c-531f-445c-adcf-b75b2ab93c34","metricName":"change","datafeedName":"Stock price","dataStartFrom":1105315200000}}],"gran":{"granularityString":"Daily","customInSeconds":0},"instance":{"instanceName":"Maga_Instance_1586447708033","instanceId":"528cbe52-cb6a-44c0-b388-580aba57f2f7","status":"Active","appId":"173276d9-a7ed-494b-9300-6dd1aa09f2c3","appName":"Maga","appDisplayName":"Maga","appType":"Internal","remoteModelKey":"","params":{"mergeMode":"Outer","tracebackWindow":28}},"startTime":"2020-03-05T00:00:00Z","endTime":"2020-05-18T00:00:00Z"}'
#response = maga_plugin.train(request)
#print(response)
response = { 'modelId' : '6a4e3c1c-b2c9-11ea-a98b-da85f6078a2f'}
status = maga_plugin.state(request, response['modelId'])
#print(status)
#inference_result = maga_plugin.inference(request, response['modelId'])
#print(inference_result)
models = maga_plugin.list_models(request)
print(models)
delete_result = maga_plugin.delete(request, response['modelId'])
print(delete_result) | 73.285714 | 1,277 | 0.747076 | 223 | 2,052 | 6.73991 | 0.569507 | 0.046574 | 0.043912 | 0.053892 | 0.266134 | 0.202262 | 0.202262 | 0.202262 | 0.133067 | 0.133067 | 0 | 0.145026 | 0.069201 | 2,052 | 28 | 1,278 | 73.285714 | 0.641885 | 0.076998 | 0 | 0 | 0 | 0.066667 | 0.724868 | 0.697355 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.266667 | 0 | 0.266667 | 0.133333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
468a88c64c36faaf5832204b3c9a110f7e2cc1f6 | 305 | py | Python | hknweb/academics/views/course_surveys/survey.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/academics/views/course_surveys/survey.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | hknweb/academics/views/course_surveys/survey.py | jyxzhang/hknweb | a01ffd8587859bf63c46213be6a0c8b87164a5c2 | [
"MIT"
] | null | null | null | from hknweb.academics.views.base_viewset import AcademicEntityViewSet
from hknweb.academics.models import Survey
from hknweb.academics.serializers import SurveySerializer
class SurveyViewSet(AcademicEntityViewSet):
queryset = Survey.objects.order_by("-id")
serializer_class = SurveySerializer
| 27.727273 | 69 | 0.832787 | 32 | 305 | 7.84375 | 0.625 | 0.119522 | 0.227092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104918 | 305 | 10 | 70 | 30.5 | 0.919414 | 0 | 0 | 0 | 0 | 0 | 0.009836 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
46927d22c47cf1dbaf9da85001f7d298bc14431c | 168 | py | Python | Control/routing.py | PPPokerFace/PokerFace | 4d28a3bb093200669f2f7b337a907f035b650032 | [
"MIT"
] | 1 | 2019-01-06T08:33:24.000Z | 2019-01-06T08:33:24.000Z | Control/routing.py | PPPokerFace/PokerFace | 4d28a3bb093200669f2f7b337a907f035b650032 | [
"MIT"
] | null | null | null | Control/routing.py | PPPokerFace/PokerFace | 4d28a3bb093200669f2f7b337a907f035b650032 | [
"MIT"
] | null | null | null | # chat/routing.py
from django.conf.urls import url
from . import consumers
websocket_urlpatterns = [
url('ws/welcome-data/', consumers.WelcomeDataShowConsumer),
] | 21 | 63 | 0.761905 | 20 | 168 | 6.35 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 168 | 8 | 64 | 21 | 0.863946 | 0.089286 | 0 | 0 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d3b845cc16db871e21dbbde14211d3310afc2cc6 | 495 | py | Python | build/lib/g3ar/dict_parser/__init__.py | VillanCh/g3ar | 99e01dacc130b02a3759ff04b1d36c6b9e0111ff | [
"BSD-2-Clause"
] | 48 | 2016-12-20T18:48:07.000Z | 2021-07-28T07:39:38.000Z | build/lib/g3ar/dict_parser/__init__.py | VillanCh/g3ar | 99e01dacc130b02a3759ff04b1d36c6b9e0111ff | [
"BSD-2-Clause"
] | null | null | null | build/lib/g3ar/dict_parser/__init__.py | VillanCh/g3ar | 99e01dacc130b02a3759ff04b1d36c6b9e0111ff | [
"BSD-2-Clause"
] | 24 | 2016-12-21T02:18:12.000Z | 2021-11-30T04:19:45.000Z | #!/usr/bin/env python
#coding:utf-8
"""
Author: --<v1ll4n>
Purpose: Simple and Quick Parse your dictionary FOR TENTEST PROGRAMMER!
Created: 2016/12/16
"""
from . import dict_parser
from .dict_parser import *
def get_dictparser(filename,
session_id=DEFAULT_SESSION_ID,
do_continue=False,
session_data_file=SESSION_TABLE_FILE):
return DictParser(filename, session_id, do_continue, session_data_file)
| 26.052632 | 76 | 0.646465 | 59 | 495 | 5.169492 | 0.694915 | 0.088525 | 0.163934 | 0.177049 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030471 | 0.270707 | 495 | 19 | 77 | 26.052632 | 0.814404 | 0.292929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0.142857 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3103b4788675e9cb4050a8bdcd25e3d0681930f6 | 971 | py | Python | offline/migrations/0001_initial.py | subaaaaaa/subapp | b9747dcd2d39e62b6dcca739016dae5c5aff3e9c | [
"MIT"
] | null | null | null | offline/migrations/0001_initial.py | subaaaaaa/subapp | b9747dcd2d39e62b6dcca739016dae5c5aff3e9c | [
"MIT"
] | 6 | 2020-06-05T17:57:17.000Z | 2021-09-07T23:50:31.000Z | offline/migrations/0001_initial.py | subaaaaaa/subapp | b9747dcd2d39e62b6dcca739016dae5c5aff3e9c | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2018-01-06 22:29
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lead',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('lno', models.CharField(max_length=20)),
('jname', models.CharField(max_length=50)),
('tel', models.CharField(max_length=20)),
('postal', models.CharField(max_length=15)),
('address1', models.CharField(max_length=100)),
('address2', models.CharField(max_length=100)),
('address3', models.CharField(max_length=100)),
('created_date', models.DateTimeField(default=django.utils.timezone.now)),
],
),
]
| 32.366667 | 114 | 0.578785 | 99 | 971 | 5.565657 | 0.555556 | 0.190563 | 0.228675 | 0.3049 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 0.048921 | 0.284243 | 971 | 29 | 115 | 33.482759 | 0.743885 | 0.044284 | 0 | 0 | 1 | 0 | 0.065875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.090909 | 0 | 0.272727 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
310b67ff16e502405bfed3fccd6624f2f82cd5d3 | 183 | py | Python | python/hello.py | ViniKim/TIL | 7597c885b6e154cb72c1a736acc1f6cb32d5481c | [
"MIT"
] | null | null | null | python/hello.py | ViniKim/TIL | 7597c885b6e154cb72c1a736acc1f6cb32d5481c | [
"MIT"
] | null | null | null | python/hello.py | ViniKim/TIL | 7597c885b6e154cb72c1a736acc1f6cb32d5481c | [
"MIT"
] | 1 | 2018-05-23T03:35:10.000Z | 2018-05-23T03:35:10.000Z | for i in range(101):
if i % 15 == 0:
print("Fizzbuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
| 14.076923 | 25 | 0.409836 | 26 | 183 | 2.884615 | 0.615385 | 0.24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.095238 | 0.42623 | 183 | 12 | 26 | 15.25 | 0.619048 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.444444 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
312870af3684643bac6541d205cc6db93de3c886 | 1,457 | py | Python | example/test_example.py | seberg/pytest-valgrind | 13ea6334ff19ba636c6e235524ca807c7b4c0fc8 | [
"MIT"
] | 7 | 2019-04-05T02:20:18.000Z | 2021-02-02T19:17:11.000Z | example/test_example.py | fridex/pytest-valgrind | 886f328b20b8a354bdf06c3db58c7b7c04f45f20 | [
"MIT"
] | 2 | 2020-05-22T20:32:11.000Z | 2020-09-07T22:44:45.000Z | example/test_example.py | seberg/pytest-valgrind | 13ea6334ff19ba636c6e235524ca807c7b4c0fc8 | [
"MIT"
] | 2 | 2020-03-14T20:20:02.000Z | 2020-11-12T14:20:27.000Z | """
This is a minimal example of tests which fail in pytest and can be used to
check that it is working correctly.
Run this example with:
```shell
PYTHONMALLOC=malloc valgrind --show-leak-kinds=definite --log-file=/tmp/valgrind-output \
python -m pytest -vv --valgrind --valgrind-log=/tmp/valgrind-output
```
You can find a sample output (hopefully not completely outdated) next to this
file.
"""
import pytest
from pytest_valgrind.valgrind import create_leak, access_invalid
def test_all_good():
# This test just passes, yay!
pass
def test_fails_but_valgrind_good():
assert 0
def test_valgrind_error():
# Test accesses invalid/uninitialized data on the C level
access_invalid()
def test_valgrind_leak():
# Test leaks a bit of memory on the C level
create_leak()
def test_valgrind_error_and_leak():
# Test both access invalid/unitialized data and creates a leak
access_invalid()
create_leak()
@pytest.mark.valgrind_known_leak(reason="Leaks intentionally")
def test_valgrind_leak_ignored():
create_leak()
@pytest.mark.valgrind_known_error(reason="Errors intentionally")
def test_valgrind_error_ignored():
access_invalid()
@pytest.mark.valgrind_known_leak(reason="Leaks intentionally")
def test_valgrind_leak_ignored_but_errors_as_well():
create_leak()
access_invalid()
def test_another_good_test():
# Just to show that the old leaks are obviously not still found.
pass | 23.126984 | 89 | 0.754976 | 212 | 1,457 | 4.966981 | 0.429245 | 0.059829 | 0.08547 | 0.05698 | 0.244065 | 0.244065 | 0.146249 | 0.146249 | 0.146249 | 0.146249 | 0 | 0.000819 | 0.161977 | 1,457 | 63 | 90 | 23.126984 | 0.861589 | 0.442004 | 0 | 0.48 | 0 | 0 | 0.0725 | 0 | 0 | 0 | 0 | 0 | 0.04 | 1 | 0.36 | true | 0.08 | 0.08 | 0 | 0.44 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
3135f61408aed321aae6c6d11f6424d403308486 | 45 | py | Python | config.py | jackklys/reweightedwakesleep | d235bec859e4dd274ccc27e1a552ce176621d4f3 | [
"MIT"
] | null | null | null | config.py | jackklys/reweightedwakesleep | d235bec859e4dd274ccc27e1a552ce176621d4f3 | [
"MIT"
] | null | null | null | config.py | jackklys/reweightedwakesleep | d235bec859e4dd274ccc27e1a552ce176621d4f3 | [
"MIT"
] | null | null | null | DATASETS_DIR = '/datasets/'
RESULTS_DIR = ''
| 15 | 27 | 0.688889 | 5 | 45 | 5.8 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 45 | 2 | 28 | 22.5 | 0.74359 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
313b8bff3f09535acc072121eee135af49bbc195 | 13,200 | py | Python | fonts/FreeSansBold9pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | fonts/FreeSansBold9pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | fonts/FreeSansBold9pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | FreeSansBold9pt7bBitmaps = [
0xFF, 0xFF, 0xFE, 0x48, 0x7E, 0xEF, 0xDF, 0xBF, 0x74, 0x40, 0x19, 0x86,
0x67, 0xFD, 0xFF, 0x33, 0x0C, 0xC3, 0x33, 0xFE, 0xFF, 0x99, 0x86, 0x61,
0x90, 0x10, 0x1F, 0x1F, 0xDE, 0xFF, 0x3F, 0x83, 0xC0, 0xFC, 0x1F, 0x09,
0xFC, 0xFE, 0xF7, 0xF1, 0xE0, 0x40, 0x38, 0x10, 0x7C, 0x30, 0xC6, 0x20,
0xC6, 0x40, 0xC6, 0x40, 0x7C, 0x80, 0x39, 0x9C, 0x01, 0x3E, 0x03, 0x63,
0x02, 0x63, 0x04, 0x63, 0x0C, 0x3E, 0x08, 0x1C, 0x0E, 0x01, 0xF8, 0x3B,
0x83, 0xB8, 0x3F, 0x01, 0xE0, 0x3E, 0x67, 0x76, 0xE3, 0xEE, 0x1C, 0xF3,
0xC7, 0xFE, 0x3F, 0x70, 0xFF, 0xF4, 0x18, 0x63, 0x1C, 0x73, 0x8E, 0x38,
0xE3, 0x8E, 0x18, 0x70, 0xC3, 0x06, 0x08, 0x61, 0x83, 0x0E, 0x38, 0x71,
0xC7, 0x1C, 0x71, 0xC6, 0x38, 0xE3, 0x18, 0x40, 0x21, 0x3E, 0x45, 0x28,
0x38, 0x70, 0xE7, 0xFF, 0xE7, 0x0E, 0x1C, 0xFC, 0x9C, 0xFF, 0xC0, 0xFC,
0x08, 0xC4, 0x23, 0x10, 0x84, 0x62, 0x11, 0x88, 0x00, 0x3E, 0x3F, 0x9D,
0xDC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, 0xE3, 0xF1, 0xDD, 0xCF, 0xE3, 0xE0,
0x08, 0xFF, 0xF3, 0x9C, 0xE7, 0x39, 0xCE, 0x73, 0x80, 0x3E, 0x3F, 0xB8,
0xFC, 0x70, 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x0F, 0xF7, 0xF8,
0x3C, 0x7F, 0xE7, 0xE7, 0x07, 0x0C, 0x0E, 0x07, 0x07, 0xE7, 0xE7, 0x7E,
0x3C, 0x0E, 0x1E, 0x1E, 0x2E, 0x2E, 0x4E, 0x4E, 0x8E, 0xFF, 0xFF, 0x0E,
0x0E, 0x0E, 0x7F, 0x3F, 0x90, 0x18, 0x0D, 0xE7, 0xFB, 0x9E, 0x07, 0x03,
0x81, 0xF1, 0xFF, 0xE7, 0xC0, 0x3E, 0x3F, 0x9C, 0xFC, 0x0E, 0xE7, 0xFB,
0xDF, 0xC7, 0xE3, 0xF1, 0xDD, 0xEF, 0xE3, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0,
0xE0, 0x60, 0x70, 0x30, 0x38, 0x1C, 0x0C, 0x0E, 0x07, 0x03, 0x80, 0x3F,
0x1F, 0xEE, 0x3F, 0x87, 0xE3, 0xCF, 0xC7, 0xFB, 0xCF, 0xE1, 0xF8, 0x7F,
0x3D, 0xFE, 0x3F, 0x00, 0x3E, 0x3F, 0xBD, 0xDC, 0x7E, 0x3F, 0x1F, 0xDE,
0xFF, 0x3B, 0x81, 0xF9, 0xCF, 0xE3, 0xC0, 0xFC, 0x00, 0x07, 0xE0, 0xFC,
0x00, 0x07, 0xE5, 0xE0, 0x00, 0x83, 0xC7, 0xDF, 0x0C, 0x07, 0x80, 0xF8,
0x1F, 0x01, 0x80, 0xFF, 0xFF, 0xC0, 0x00, 0x0F, 0xFF, 0xFC, 0x00, 0x70,
0x3F, 0x03, 0xE0, 0x38, 0x7D, 0xF1, 0xE0, 0x80, 0x00, 0x3E, 0x3F, 0xB8,
0xFC, 0x70, 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x0E, 0x00, 0x03, 0x81, 0xC0,
0x03, 0xF0, 0x0F, 0xFC, 0x1E, 0x0E, 0x38, 0x02, 0x70, 0xE9, 0x63, 0x19,
0xC2, 0x19, 0xC6, 0x11, 0xC6, 0x33, 0xC6, 0x32, 0x63, 0xFE, 0x73, 0xDC,
0x3C, 0x00, 0x1F, 0xF8, 0x07, 0xF0, 0x07, 0x00, 0xF0, 0x0F, 0x80, 0xF8,
0x1D, 0x81, 0x9C, 0x19, 0xC3, 0x8C, 0x3F, 0xE7, 0xFE, 0x70, 0x66, 0x07,
0xE0, 0x70, 0xFF, 0x9F, 0xFB, 0x83, 0xF0, 0x7E, 0x0F, 0xFF, 0x3F, 0xF7,
0x06, 0xE0, 0xFC, 0x1F, 0x83, 0xFF, 0xEF, 0xF8, 0x1F, 0x83, 0xFE, 0x78,
0xE7, 0x07, 0xE0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0xE0, 0x07, 0x07, 0x78,
0xF3, 0xFE, 0x1F, 0x80, 0xFF, 0x8F, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0, 0x7E,
0x07, 0xE0, 0x7E, 0x07, 0xE0, 0x7E, 0x0E, 0xE0, 0xEF, 0xFC, 0xFF, 0x80,
0xFF, 0xFF, 0xF8, 0x1C, 0x0E, 0x07, 0xFB, 0xFD, 0xC0, 0xE0, 0x70, 0x38,
0x1F, 0xFF, 0xF8, 0xFF, 0xFF, 0xF8, 0x1C, 0x0E, 0x07, 0xFB, 0xFD, 0xC0,
0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x00, 0x0F, 0x87, 0xF9, 0xE3, 0xB8, 0x3E,
0x01, 0xC0, 0x38, 0xFF, 0x1F, 0xE0, 0x6E, 0x0D, 0xE3, 0x9F, 0xD0, 0xF2,
0xE0, 0xFC, 0x1F, 0x83, 0xF0, 0x7E, 0x0F, 0xFF, 0xFF, 0xFF, 0x07, 0xE0,
0xFC, 0x1F, 0x83, 0xF0, 0x7E, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x07,
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xE7, 0xE7, 0xE7, 0x7E, 0x3C,
0xE0, 0xEE, 0x1C, 0xE3, 0x8E, 0x70, 0xEE, 0x0F, 0xC0, 0xFE, 0x0F, 0x70,
0xE7, 0x0E, 0x38, 0xE1, 0xCE, 0x0E, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xFF, 0xFF, 0xF8, 0x7F, 0xE1,
0xFF, 0x87, 0xFE, 0x1F, 0xEC, 0x7F, 0xB3, 0x7E, 0xCD, 0xFB, 0x37, 0xEC,
0xDF, 0x9E, 0x7E, 0x79, 0xF9, 0xE7, 0xE7, 0x9C, 0xE0, 0xFE, 0x1F, 0xC3,
0xFC, 0x7F, 0xCF, 0xD9, 0xFB, 0xBF, 0x37, 0xE7, 0xFC, 0x7F, 0x87, 0xF0,
0xFE, 0x0E, 0x0F, 0x81, 0xFF, 0x1E, 0x3C, 0xE0, 0xEE, 0x03, 0xF0, 0x1F,
0x80, 0xFC, 0x07, 0xE0, 0x3B, 0x83, 0x9E, 0x3C, 0x7F, 0xC0, 0xF8, 0x00,
0xFF, 0x9F, 0xFB, 0x87, 0xF0, 0x7E, 0x0F, 0xC3, 0xFF, 0xF7, 0xFC, 0xE0,
0x1C, 0x03, 0x80, 0x70, 0x0E, 0x00, 0x0F, 0x81, 0xFF, 0x1E, 0x3C, 0xE0,
0xEE, 0x03, 0xF0, 0x1F, 0x80, 0xFC, 0x07, 0xE1, 0xBB, 0x8F, 0x9E, 0x3C,
0x7F, 0xE0, 0xFB, 0x80, 0x08, 0xFF, 0x8F, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0,
0xEE, 0x0E, 0xFF, 0xCF, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0, 0xEE, 0x0E, 0xE0,
0xF0, 0x3F, 0x0F, 0xFB, 0xC7, 0xF0, 0x7E, 0x01, 0xFC, 0x1F, 0xF0, 0x3F,
0x00, 0xFC, 0x1D, 0xC7, 0xBF, 0xE1, 0xF8, 0xFF, 0xFF, 0xC7, 0x03, 0x81,
0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0xFC,
0x1F, 0x83, 0xF0, 0x7E, 0x0F, 0xC1, 0xF8, 0x3F, 0x07, 0xE0, 0xFC, 0x1F,
0xC7, 0xBF, 0xE1, 0xF0, 0x60, 0x67, 0x0E, 0x70, 0xE3, 0x0C, 0x30, 0xC3,
0x9C, 0x19, 0x81, 0x98, 0x1F, 0x80, 0xF0, 0x0F, 0x00, 0xF0, 0x06, 0x00,
0x61, 0xC3, 0xB8, 0xE1, 0x9C, 0x70, 0xCE, 0x3C, 0xE3, 0x36, 0x71, 0x9B,
0x30, 0xED, 0x98, 0x36, 0x7C, 0x1B, 0x3C, 0x0F, 0x1E, 0x07, 0x8F, 0x01,
0xC3, 0x80, 0xE1, 0x80, 0x70, 0xE7, 0x8E, 0x39, 0xC1, 0xF8, 0x1F, 0x80,
0xF0, 0x07, 0x00, 0xF0, 0x1F, 0x81, 0x9C, 0x39, 0xC7, 0x0E, 0x70, 0xE0,
0xE0, 0xFC, 0x39, 0xC7, 0x18, 0xC3, 0xB8, 0x36, 0x07, 0xC0, 0x70, 0x0E,
0x01, 0xC0, 0x38, 0x07, 0x00, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0, 0xE0, 0xF0,
0x70, 0x70, 0x70, 0x78, 0x38, 0x38, 0x1F, 0xFF, 0xF8, 0xFF, 0xEE, 0xEE,
0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xF0, 0x86, 0x10, 0x86, 0x10, 0x84, 0x30,
0x84, 0x30, 0x80, 0xFF, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xF0,
0x18, 0x1C, 0x3C, 0x3E, 0x36, 0x66, 0x63, 0xC3, 0xFF, 0xC0, 0xCC, 0x3F,
0x1F, 0xEE, 0x38, 0x0E, 0x3F, 0x9E, 0xEE, 0x3B, 0x9E, 0xFF, 0x9E, 0xE0,
0xE0, 0x38, 0x0E, 0x03, 0xBC, 0xFF, 0xBC, 0xEE, 0x1F, 0x87, 0xE1, 0xF8,
0x7F, 0x3B, 0xFE, 0xEF, 0x00, 0x1F, 0x3F, 0xDC, 0x7C, 0x0E, 0x07, 0x03,
0x80, 0xE3, 0x7F, 0x8F, 0x00, 0x03, 0x81, 0xC0, 0xE7, 0x77, 0xFB, 0xBF,
0x8F, 0xC7, 0xE3, 0xF1, 0xFD, 0xEF, 0xF3, 0xB8, 0x3E, 0x3F, 0x9C, 0xDC,
0x3F, 0xFF, 0xFF, 0x81, 0xC3, 0x7F, 0x8F, 0x00, 0x3B, 0xDD, 0xFF, 0xB9,
0xCE, 0x73, 0x9C, 0xE7, 0x00, 0x3B, 0xBF, 0xDD, 0xFC, 0x7E, 0x3F, 0x1F,
0x8F, 0xEF, 0x7F, 0x9D, 0xC0, 0xFC, 0x77, 0xF1, 0xF0, 0xE0, 0x70, 0x38,
0x1D, 0xEF, 0xFF, 0x9F, 0x8F, 0xC7, 0xE3, 0xF1, 0xF8, 0xFC, 0x7E, 0x38,
0xFC, 0x7F, 0xFF, 0xFF, 0xFE, 0x77, 0x07, 0x77, 0x77, 0x77, 0x77, 0x77,
0x7F, 0xE0, 0xE0, 0x70, 0x38, 0x1C, 0x7E, 0x77, 0x73, 0xF1, 0xF8, 0xFE,
0x77, 0x39, 0xDC, 0x6E, 0x38, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0x7B,
0xFF, 0xFE, 0x39, 0xF8, 0xE7, 0xE3, 0x9F, 0x8E, 0x7E, 0x39, 0xF8, 0xE7,
0xE3, 0x9F, 0x8E, 0x70, 0xEF, 0x7F, 0xF8, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F,
0xC7, 0xE3, 0xF1, 0xC0, 0x1E, 0x1F, 0xE7, 0x3B, 0x87, 0xE1, 0xF8, 0x7E,
0x1D, 0xCE, 0x7F, 0x87, 0x80, 0xEF, 0x3F, 0xEF, 0x3B, 0x87, 0xE1, 0xF8,
0x7E, 0x1F, 0xCE, 0xFF, 0xBB, 0xCE, 0x03, 0x80, 0xE0, 0x38, 0x00, 0x3B,
0xBF, 0xFD, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xEF, 0x7F, 0x9D, 0xC0, 0xE0,
0x70, 0x38, 0x1C, 0xEF, 0xFF, 0x38, 0xE3, 0x8E, 0x38, 0xE3, 0x80, 0x3E,
0x3F, 0xB8, 0xFC, 0x0F, 0xC3, 0xFC, 0x3F, 0xC7, 0xFF, 0x1F, 0x00, 0x73,
0xBF, 0xF7, 0x39, 0xCE, 0x73, 0x9E, 0x70, 0xE3, 0xF1, 0xF8, 0xFC, 0x7E,
0x3F, 0x1F, 0x8F, 0xC7, 0xFF, 0xBD, 0xC0, 0xE1, 0x98, 0x67, 0x39, 0xCC,
0x33, 0x0D, 0xC3, 0xE0, 0x78, 0x1E, 0x07, 0x00, 0xE3, 0x1D, 0x9E, 0x66,
0x79, 0x99, 0xE6, 0x77, 0xB8, 0xD2, 0xC3, 0xCF, 0x0F, 0x3C, 0x3C, 0xF0,
0x73, 0x80, 0x73, 0x9C, 0xE3, 0xF0, 0x78, 0x1E, 0x07, 0x81, 0xE0, 0xFC,
0x73, 0x9C, 0xE0, 0xE1, 0xD8, 0x67, 0x39, 0xCE, 0x33, 0x0E, 0xC3, 0xE0,
0x78, 0x1E, 0x03, 0x00, 0xC0, 0x70, 0x38, 0x0E, 0x00, 0xFE, 0xFE, 0x0E,
0x1C, 0x38, 0x38, 0x70, 0xE0, 0xFF, 0xFF, 0x37, 0x66, 0x66, 0x6E, 0xE6,
0x66, 0x66, 0x67, 0x30, 0xFF, 0xFF, 0x80, 0xCE, 0x66, 0x66, 0x67, 0x76,
0x66, 0x66, 0x6E, 0xC0, 0x71, 0x8E ]
FreeSansBold9pt7bGlyphs = [
[ 0, 0, 0, 5, 0, 1 ], # 0x20 ' '
[ 0, 3, 13, 6, 2, -12 ], # 0x21 '!'
[ 5, 7, 5, 9, 1, -12 ], # 0x22 '"'
[ 10, 10, 12, 10, 0, -11 ], # 0x23 '#'
[ 25, 9, 15, 10, 1, -13 ], # 0x24 '$'
[ 42, 16, 13, 16, 0, -12 ], # 0x25 '%'
[ 68, 12, 13, 13, 1, -12 ], # 0x26 '&'
[ 88, 3, 5, 5, 1, -12 ], # 0x27 '''
[ 90, 6, 17, 6, 1, -12 ], # 0x28 '('
[ 103, 6, 17, 6, 0, -12 ], # 0x29 ')'
[ 116, 5, 6, 7, 1, -12 ], # 0x2A '#'
[ 120, 7, 8, 11, 2, -7 ], # 0x2B '+'
[ 127, 3, 5, 4, 1, -1 ], # 0x2C ','
[ 129, 5, 2, 6, 0, -5 ], # 0x2D '-'
[ 131, 3, 2, 4, 1, -1 ], # 0x2E '.'
[ 132, 5, 13, 5, 0, -12 ], # 0x2F '/'
[ 141, 9, 13, 10, 1, -12 ], # 0x30 '0'
[ 156, 5, 13, 10, 2, -12 ], # 0x31 '1'
[ 165, 9, 13, 10, 1, -12 ], # 0x32 '2'
[ 180, 8, 13, 10, 1, -12 ], # 0x33 '3'
[ 193, 8, 13, 10, 2, -12 ], # 0x34 '4'
[ 206, 9, 13, 10, 1, -12 ], # 0x35 '5'
[ 221, 9, 13, 10, 1, -12 ], # 0x36 '6'
[ 236, 9, 13, 10, 0, -12 ], # 0x37 '7'
[ 251, 10, 13, 10, 0, -12 ], # 0x38 '8'
[ 268, 9, 13, 10, 1, -12 ], # 0x39 '9'
[ 283, 3, 9, 4, 1, -8 ], # 0x3A ':'
[ 287, 3, 12, 4, 1, -8 ], # 0x3B ''
[ 292, 9, 9, 11, 1, -8 ], # 0x3C '<'
[ 303, 9, 6, 11, 1, -6 ], # 0x3D '='
[ 310, 9, 9, 11, 1, -8 ], # 0x3E '>'
[ 321, 9, 13, 11, 1, -12 ], # 0x3F '?'
[ 336, 16, 15, 18, 0, -12 ], # 0x40 '@'
[ 366, 12, 13, 13, 0, -12 ], # 0x41 'A'
[ 386, 11, 13, 13, 1, -12 ], # 0x42 'B'
[ 404, 12, 13, 13, 1, -12 ], # 0x43 'C'
[ 424, 12, 13, 13, 1, -12 ], # 0x44 'D'
[ 444, 9, 13, 12, 1, -12 ], # 0x45 'E'
[ 459, 9, 13, 11, 1, -12 ], # 0x46 'F'
[ 474, 11, 13, 14, 1, -12 ], # 0x47 'G'
[ 492, 11, 13, 13, 1, -12 ], # 0x48 'H'
[ 510, 3, 13, 6, 1, -12 ], # 0x49 'I'
[ 515, 8, 13, 10, 1, -12 ], # 0x4A 'J'
[ 528, 12, 13, 13, 1, -12 ], # 0x4B 'K'
[ 548, 8, 13, 11, 1, -12 ], # 0x4C 'L'
[ 561, 14, 13, 16, 1, -12 ], # 0x4D 'M'
[ 584, 11, 13, 14, 1, -12 ], # 0x4E 'N'
[ 602, 13, 13, 14, 1, -12 ], # 0x4F 'O'
[ 624, 11, 13, 12, 1, -12 ], # 0x50 'P'
[ 642, 13, 14, 14, 1, -12 ], # 0x51 'Q'
[ 665, 12, 13, 13, 1, -12 ], # 0x52 'R'
[ 685, 11, 13, 12, 1, -12 ], # 0x53 'S'
[ 703, 9, 13, 12, 2, -12 ], # 0x54 'T'
[ 718, 11, 13, 13, 1, -12 ], # 0x55 'U'
[ 736, 12, 13, 12, 0, -12 ], # 0x56 'V'
[ 756, 17, 13, 17, 0, -12 ], # 0x57 'W'
[ 784, 12, 13, 12, 0, -12 ], # 0x58 'X'
[ 804, 11, 13, 12, 1, -12 ], # 0x59 'Y'
[ 822, 9, 13, 11, 1, -12 ], # 0x5A 'Z'
[ 837, 4, 17, 6, 1, -12 ], # 0x5B '['
[ 846, 5, 13, 5, 0, -12 ], # 0x5C '\'
[ 855, 4, 17, 6, 0, -12 ], # 0x5D ']'
[ 864, 8, 8, 11, 1, -12 ], # 0x5E '^'
[ 872, 10, 1, 10, 0, 4 ], # 0x5F '_'
[ 874, 3, 2, 5, 0, -12 ], # 0x60 '`'
[ 875, 10, 10, 10, 1, -9 ], # 0x61 'a'
[ 888, 10, 13, 11, 1, -12 ], # 0x62 'b'
[ 905, 9, 10, 10, 1, -9 ], # 0x63 'c'
[ 917, 9, 13, 11, 1, -12 ], # 0x64 'd'
[ 932, 9, 10, 10, 1, -9 ], # 0x65 'e'
[ 944, 5, 13, 6, 1, -12 ], # 0x66 'f'
[ 953, 9, 14, 11, 1, -9 ], # 0x67 'g'
[ 969, 9, 13, 11, 1, -12 ], # 0x68 'h'
[ 984, 3, 13, 5, 1, -12 ], # 0x69 'i'
[ 989, 4, 17, 5, 0, -12 ], # 0x6A 'j'
[ 998, 9, 13, 10, 1, -12 ], # 0x6B 'k'
[ 1013, 3, 13, 5, 1, -12 ], # 0x6C 'l'
[ 1018, 14, 10, 16, 1, -9 ], # 0x6D 'm'
[ 1036, 9, 10, 11, 1, -9 ], # 0x6E 'n'
[ 1048, 10, 10, 11, 1, -9 ], # 0x6F 'o'
[ 1061, 10, 14, 11, 1, -9 ], # 0x70 'p'
[ 1079, 9, 14, 11, 1, -9 ], # 0x71 'q'
[ 1095, 6, 10, 7, 1, -9 ], # 0x72 'r'
[ 1103, 9, 10, 10, 1, -9 ], # 0x73 's'
[ 1115, 5, 12, 6, 1, -11 ], # 0x74 't'
[ 1123, 9, 10, 11, 1, -9 ], # 0x75 'u'
[ 1135, 10, 10, 10, 0, -9 ], # 0x76 'v'
[ 1148, 14, 10, 14, 0, -9 ], # 0x77 'w'
[ 1166, 10, 10, 10, 0, -9 ], # 0x78 'x'
[ 1179, 10, 14, 10, 0, -9 ], # 0x79 'y'
[ 1197, 8, 10, 9, 1, -9 ], # 0x7A 'z'
[ 1207, 4, 17, 7, 1, -12 ], # 0x7B '['
[ 1216, 1, 17, 5, 2, -12 ], # 0x7C '|'
[ 1219, 4, 17, 7, 2, -12 ], # 0x7D ']'
[ 1228, 8, 2, 9, 0, -4 ] ] # 0x7E '~'
FreeSansBold9pt7b = [
FreeSansBold9pt7bBitmaps,
FreeSansBold9pt7bGlyphs,
0x20, 0x7E, 22 ]
# Approx. 1902 bytes
| 63.157895 | 75 | 0.493258 | 1,968 | 13,200 | 3.307927 | 0.167175 | 0.019816 | 0.020277 | 0.024578 | 0.228571 | 0.134562 | 0.10384 | 0.062058 | 0.062058 | 0.050998 | 0 | 0.435665 | 0.324091 | 13,200 | 208 | 76 | 63.461538 | 0.293992 | 0.065909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.402911 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
313bfddd29779ce7be2de2c9a74248e03a73d8c5 | 707 | py | Python | sandbox/py-sandbox/solver/gen2.py | SECCON/SECCON2020_online_CTF | dd639d140ad61ea0fbfadb7827157ca53f7b88b2 | [
"Apache-2.0"
] | 3 | 2020-11-02T06:53:39.000Z | 2021-12-10T00:59:01.000Z | sandbox/py-sandbox/solver/gen2.py | SECCON/SECCON2020_online_CTF | dd639d140ad61ea0fbfadb7827157ca53f7b88b2 | [
"Apache-2.0"
] | null | null | null | sandbox/py-sandbox/solver/gen2.py | SECCON/SECCON2020_online_CTF | dd639d140ad61ea0fbfadb7827157ca53f7b88b2 | [
"Apache-2.0"
] | null | null | null | s = '''
[setattr(f, 'func_code', type(f.func_code)(0, 0, 2, 67,
'd\\x06\\x00j\\x00\\x00j\\x01\\x00d\\x01\\x00\\x19j\\x02\\x00\\x83\\x00\\x00d\\x02\\x00\\x19j\\x03\\x00j\\x04\\x00d\\x03\\x00\\x19j\\x05\\x00d\\x04\\x00\\x19j\\x06\\x00j\\x07\\x00d\\x05\\x00\\x83\\x01\\x00\\x01d\\x00\\x00'
+ 's'.upper(),
([].append(1), 0, 59, 'sys', 'o' + 's.path', 'sh', ()), ('_' + '_cl' + 'ass_' + '_',
'_' + '_bas' + 'es_' + '_',
'_' + '_subcl' + 'asses_' + '_',
'_' + '_init_' + '_',
'func_glob' + 'als',
'mod' + 'ules',
'o' + 's',
'sy' + 'stem'), (), '', '', 0, '')) + f() for\tf\tin [lambda\t: 1]]
'''
s = s.replace('\n', '').replace(' ', '')
print(s)
| 37.210526 | 222 | 0.438472 | 97 | 707 | 3 | 0.536082 | 0.09622 | 0.061856 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165187 | 0.203678 | 707 | 18 | 223 | 39.277778 | 0.351687 | 0 | 0 | 0 | 0 | 0.266667 | 0.915014 | 0.314448 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
315b333b4bf34a1d125d5628eed7741054227b65 | 486 | py | Python | xTool/codec/json_codec.py | fengzhongzhu1621/xTool | 5e7f4a9191d8a9a1440d033c28ec3fb59abba5c5 | [
"Apache-2.0"
] | 2 | 2020-09-02T13:46:06.000Z | 2020-10-11T16:11:02.000Z | xTool/codec/json_codec.py | fengzhongzhu1621/xTool | 5e7f4a9191d8a9a1440d033c28ec3fb59abba5c5 | [
"Apache-2.0"
] | null | null | null | xTool/codec/json_codec.py | fengzhongzhu1621/xTool | 5e7f4a9191d8a9a1440d033c28ec3fb59abba5c5 | [
"Apache-2.0"
] | 4 | 2018-10-15T07:08:34.000Z | 2019-11-26T01:52:47.000Z | # -*- coding: utf-8 -*-
from typing import Union
import rapidjson as json
from xTool.plugins.plugin import register_plugin, PluginType
from xTool.misc import tob
from .base import CodecType
@register_plugin(
PluginType.CODEC, CodecType.JSON
)
class JsonCodec:
@classmethod
def encode(cls, obj: object) -> bytes:
return json.dumps(obj).encode("utf8")
@classmethod
def decode(cls, data: Union[str, bytes]) -> object:
return json.loads(tob(data))
| 21.130435 | 60 | 0.699588 | 63 | 486 | 5.365079 | 0.571429 | 0.053254 | 0.142012 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005089 | 0.191358 | 486 | 22 | 61 | 22.090909 | 0.854962 | 0.04321 | 0 | 0.133333 | 0 | 0 | 0.008639 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.333333 | 0.133333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
315c03e6d47c50480f52cfb8b6b81233f611f878 | 67 | py | Python | mlbench_core/models/tensorflow/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | 14 | 2018-11-12T17:23:32.000Z | 2022-03-11T22:45:49.000Z | mlbench_core/models/tensorflow/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | 330 | 2018-10-09T12:15:56.000Z | 2022-03-01T18:07:40.000Z | mlbench_core/models/tensorflow/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | 9 | 2019-02-28T19:11:58.000Z | 2020-08-17T17:52:37.000Z | from .resnet_model import Cifar10Model
__all__ = ["Cifar10Model"]
| 16.75 | 38 | 0.791045 | 7 | 67 | 6.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067797 | 0.119403 | 67 | 3 | 39 | 22.333333 | 0.745763 | 0 | 0 | 0 | 0 | 0 | 0.179104 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
317d7d8fadd357dddc14fb0ff3b1b68bc7ee597a | 329 | py | Python | examples/miniapps/engines_cars/example_di.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/engines_cars/example_di.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | examples/miniapps/engines_cars/example_di.py | vlad-ghita/python-dependency-injector | 5cf5bdda24851dd97cfa0f5054f4a8c35ddac014 | [
"BSD-3-Clause"
] | null | null | null | """Dependency injection example, Cars & Engines."""
import example.cars
import example.engines
if __name__ == '__main__':
gasoline_car = example.cars.Car(example.engines.GasolineEngine())
diesel_car = example.cars.Car(example.engines.DieselEngine())
electro_car = example.cars.Car(example.engines.ElectroEngine())
| 29.909091 | 69 | 0.753799 | 38 | 329 | 6.236842 | 0.421053 | 0.253165 | 0.177215 | 0.21519 | 0.392405 | 0.392405 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115502 | 329 | 10 | 70 | 32.9 | 0.814433 | 0.136778 | 0 | 0 | 0 | 0 | 0.028777 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
31865c4f9d96fc44b276380582199a559688fd97 | 382 | py | Python | xastropy/xutils/math.py | bpholden/xastropy | 66aff0995a84c6829da65996d2379ba4c946dabe | [
"BSD-3-Clause"
] | 3 | 2015-08-23T00:32:58.000Z | 2020-12-31T02:37:52.000Z | xastropy/xutils/math.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 104 | 2015-07-17T18:31:54.000Z | 2018-06-29T17:04:09.000Z | xastropy/xutils/math.py | Kristall-WangShiwei/xastropy | 723fe56cb48d5a5c4cdded839082ee12ef8c6732 | [
"BSD-3-Clause"
] | 16 | 2015-07-17T15:50:37.000Z | 2019-04-21T03:42:47.000Z | """
#;+
#; NAME:
#; math
#; Version 1.0
#;
#; PURPOSE:
#; Module for math utilities
#; 10-Dec-2014 by JXP
#;-
#;------------------------------------------------------------------------------
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
from astropy import units as u
from xastropy.xutils import xdebug as xdb
| 19.1 | 82 | 0.544503 | 42 | 382 | 4.785714 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024768 | 0.15445 | 382 | 19 | 83 | 20.105263 | 0.597523 | 0.510471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0.25 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
31e3d0d4baaa4432092f90b3c467bc88d4261cc5 | 269 | py | Python | CythonExamples/04_CallingExternalCFunc/setup.py | jorregoh/sshpc | df3d34499d9961677981c676a3cb1ffbc8873759 | [
"MIT"
] | 2 | 2018-06-05T14:43:19.000Z | 2018-06-08T20:39:19.000Z | CythonExamples/04_CallingExternalCFunc/setup.py | jorregoh/sshpc | df3d34499d9961677981c676a3cb1ffbc8873759 | [
"MIT"
] | null | null | null | CythonExamples/04_CallingExternalCFunc/setup.py | jorregoh/sshpc | df3d34499d9961677981c676a3cb1ffbc8873759 | [
"MIT"
] | 5 | 2018-06-08T00:55:04.000Z | 2019-06-11T15:40:52.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("ejemplo1", ["ejemplo1.pyx"])]
setup(
name = 'ejemplo 1 app',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
| 26.9 | 55 | 0.765799 | 36 | 269 | 5.555556 | 0.472222 | 0.12 | 0.11 | 0.18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012712 | 0.122677 | 269 | 9 | 56 | 29.888889 | 0.834746 | 0 | 0 | 0 | 0 | 0 | 0.156134 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9ecaec48ddaa459e9572702491bf813a1f645f4a | 371 | py | Python | mpr121-daemon/process_builder.py | sandreas/raspberry-bluetooth-receiver | ccda366dd59d98ccda05caf72003baeb17a406f9 | [
"MIT"
] | 2 | 2019-10-12T17:51:09.000Z | 2020-11-19T00:27:49.000Z | mpr121-daemon/process_builder.py | sandreas/raspberry-bluetooth-receiver | ccda366dd59d98ccda05caf72003baeb17a406f9 | [
"MIT"
] | null | null | null | mpr121-daemon/process_builder.py | sandreas/raspberry-bluetooth-receiver | ccda366dd59d98ccda05caf72003baeb17a406f9 | [
"MIT"
] | 1 | 2019-06-24T06:38:11.000Z | 2019-06-24T06:38:11.000Z | #!/usr/bin/env python
from subprocess import Popen, PIPE
class ProcessBuilder:
def run(self, cmd):
self.output = ""
self.err = ""
self.p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
self.output, self.err = self.p.communicate()
return self.p.returncode
def getOutput(self):
return self.output
def getError(self):
return self.err | 23.1875 | 60 | 0.671159 | 52 | 371 | 4.788462 | 0.5 | 0.120482 | 0.11245 | 0.136546 | 0.176707 | 0.176707 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202156 | 371 | 16 | 61 | 23.1875 | 0.841216 | 0.053908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
9ed52f7adb2975aa1fa7f5bdd9aec56701f0d408 | 1,059 | py | Python | lab/lab04/tests/q3a.py | ucsb-int15/s19-assignments | 05f285576e82a835bd5375d2810ff010405574e9 | [
"MIT"
] | 2 | 2019-04-05T20:35:20.000Z | 2019-04-11T10:57:48.000Z | lab/lab04/tests/q3a.py | ucsb-int15/s19-assignments | 05f285576e82a835bd5375d2810ff010405574e9 | [
"MIT"
] | null | null | null | lab/lab04/tests/q3a.py | ucsb-int15/s19-assignments | 05f285576e82a835bd5375d2810ff010405574e9 | [
"MIT"
] | 2 | 2019-04-05T20:35:23.000Z | 2019-04-08T23:03:11.000Z | test = { 'name': 'q3a',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> diabetes_2d.shape\n'
'(442, 2)',
'hidden': False,
'locked': False},
{ 'code': '>>> -0.10 < '
'np.sum(diabetes_2d[0]) < 0\n'
'True',
'hidden': False,
'locked': False},
{ 'code': '>>> np.isclose(0, '
'np.sum(diabetes_2d))\n'
'True',
'hidden': False,
'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
| 50.428571 | 77 | 0.206799 | 53 | 1,059 | 4.075472 | 0.528302 | 0.138889 | 0.236111 | 0.305556 | 0.388889 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0.042254 | 0.664778 | 1,059 | 20 | 78 | 52.95 | 0.566197 | 0 | 0 | 0.35 | 0 | 0 | 0.208687 | 0.041549 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
9ed8a55b7195c153882139914a92ba84612e44c4 | 328 | py | Python | migrations/versions/297f71182ecc_add_384_to_48_transfer_template.py | twist-jenkins/Sample_Tracker | 8603c8c295c5d883057c6e85d6a5973902e4f5fe | [
"X11"
] | null | null | null | migrations/versions/297f71182ecc_add_384_to_48_transfer_template.py | twist-jenkins/Sample_Tracker | 8603c8c295c5d883057c6e85d6a5973902e4f5fe | [
"X11"
] | null | null | null | migrations/versions/297f71182ecc_add_384_to_48_transfer_template.py | twist-jenkins/Sample_Tracker | 8603c8c295c5d883057c6e85d6a5973902e4f5fe | [
"X11"
] | null | null | null | """add 384 to 48 transfer template
Revision ID: 297f71182ecc
Revises: 7b4ae4459f8
Create Date: 2015-09-04 16:16:19.747752
"""
# revision identifiers, used by Alembic.
revision = '297f71182ecc'
down_revision = '7b4ae4459f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def downgrade():
pass
| 14.26087 | 40 | 0.734756 | 44 | 328 | 5.454545 | 0.772727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.203704 | 0.176829 | 328 | 22 | 41 | 14.909091 | 0.685185 | 0.484756 | 0 | 0.25 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
9ee3742efaf96a87849465ef38e08a37b709d97a | 145 | py | Python | classification/run.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | classification/run.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | classification/run.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | import arguments
import main
if __name__ == '__main__':
args = arguments.parse_args()
logger, model = main.run(args, log_interval=100)
| 18.125 | 52 | 0.710345 | 19 | 145 | 4.894737 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02521 | 0.17931 | 145 | 7 | 53 | 20.714286 | 0.756303 | 0 | 0 | 0 | 0 | 0 | 0.055172 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
7303ad95181138c676f1f0f2ebed137a318900e3 | 112 | py | Python | FreeTAKServer/model/FTSModelVariables/StartTimeVariables.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | 27 | 2020-05-01T01:45:59.000Z | 2020-07-03T00:17:13.000Z | FreeTAKServer/model/FTSModelVariables/StartTimeVariables.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | 34 | 2020-04-26T11:25:52.000Z | 2020-07-03T21:06:34.000Z | FreeTAKServer/model/FTSModelVariables/StartTimeVariables.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | 15 | 2020-05-01T01:46:07.000Z | 2020-07-03T12:14:04.000Z | class StartTimeVariables:
@classmethod
def Checklist(cls):
cls.INTAG = None
return cls
| 16 | 25 | 0.625 | 11 | 112 | 6.363636 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.3125 | 112 | 6 | 26 | 18.666667 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
730b233ed3f0cd5a587123cbfe14ce7792b4c3fb | 6,269 | py | Python | sc2/unit.py | Olaf-G/Bachelor-s-Degree | d367051d9f1ff867cf433abc6a9789ac256505a3 | [
"MIT"
] | 7 | 2018-07-15T06:03:42.000Z | 2021-08-22T20:23:26.000Z | sc2/unit.py | Olaf-G/Bachelor-s-Degree | d367051d9f1ff867cf433abc6a9789ac256505a3 | [
"MIT"
] | null | null | null | sc2/unit.py | Olaf-G/Bachelor-s-Degree | d367051d9f1ff867cf433abc6a9789ac256505a3 | [
"MIT"
] | 11 | 2018-07-28T18:16:49.000Z | 2021-01-16T15:13:06.000Z | from s2clientprotocol import sc2api_pb2 as sc_pb, raw_pb2 as raw_pb
from sc2.ids.buff_id import BuffId
from .position import Point3
from .data import Alliance, Attribute, DisplayType, warpgate_abilities
from .game_data import GameData
from .ids.unit_typeid import UnitTypeId
from .ids.ability_id import AbilityId
from . import unit_command
class Unit(object):
def __init__(self, proto_data, game_data):
assert isinstance(proto_data, raw_pb.Unit)
assert isinstance(game_data, GameData)
self._proto = proto_data
self._game_data = game_data
@property
def type_id(self):
return UnitTypeId(self._proto.unit_type)
@property
def _type_data(self):
return self._game_data.units[self._proto.unit_type]
@property
def is_snapshot(self):
return self._proto.display_type == DisplayType.Snapshot.value
@property
def is_visible(self):
return self._proto.display_type == DisplayType.Visible.value
@property
def alliance(self):
return self._proto.alliance
@property
def is_mine(self):
return self._proto.alliance == Alliance.Self.value
@property
def is_enemy(self):
return self._proto.alliance == Alliance.Enemy.value
@property
def tag(self):
return self._proto.tag
@property
def owner_id(self):
return self._proto.owner
@property
def position(self):
"""2d position of the unit."""
return self.position3d.to2
@property
def position3d(self):
"""3d position of the unit."""
return Point3.from_proto(self._proto.pos)
def distance_to(self, p):
return self.position.to2.distance_to(p.position.to2)
@property
def facing(self):
return self._proto.facing
@property
def radius(self):
return self._proto.radius
@property
def detect_range(self):
return self._proto.detect_range
@property
def radar_range(self):
return self._proto.radar_range
@property
def build_progress(self):
return self._proto.build_progress
@property
def is_ready(self):
return self.build_progress == 1.0
@property
def cloak(self):
return self._proto.cloak
@property
def is_blip(self):
"""Detected by sensor tower."""
return self._proto.is_blip
@property
def is_powered(self):
return self._proto.is_powered
@property
def is_burrowed(self):
return self._proto.is_burrowed
@property
def is_flying(self):
return self._proto.is_flying
@property
def is_structure(self):
return Attribute.Structure.value in self._type_data.attributes
@property
def is_mineral_field(self):
return self._type_data.has_minerals
@property
def is_vespene_geyser(self):
return self._type_data.has_vespene
@property
def health(self):
return self._proto.health
@property
def health_max(self):
return self._proto.health_max
@property
def shield(self):
return self._proto.shield
@property
def shield_max(self):
return self._proto.shield_max
@property
def energy(self):
return self._proto.energy
@property
def mineral_contents(self):
return self._proto.mineral_contents
@property
def vespene_contents(self):
return self._proto.vespene_contents
@property
def is_selected(self):
return self._proto.is_selected
@property
def orders(self):
return [UnitOrder.from_proto(o, self._game_data) for o in self._proto.orders]
@property
def noqueue(self):
return len(self.orders) == 0
@property
def is_idle(self):
return not self.orders
@property
def add_on_tag(self):
return self._proto.add_on_tag
@property
def has_add_on(self):
return self.add_on_tag != 0
@property
def assigned_harvesters(self):
return self._proto.assigned_harvesters
@property
def ideal_harvesters(self):
return self._proto.ideal_harvesters
@property
def name(self):
return self._type_data.name
def train(self, unit, *args, **kwargs):
return self(self._game_data.units[unit.value].creation_ability.id, *args, **kwargs)
def build(self, unit, *args, **kwargs):
return self(self._game_data.units[unit.value].creation_ability.id, *args, **kwargs)
def has_buff(self, buff):
assert isinstance(buff, BuffId)
return buff.value in self._proto.buff_ids
def warp_in(self, unit, placement, *args, **kwargs):
normal_creation_ability = self._game_data.units[unit.value].creation_ability.id
return self(warpgate_abilities[normal_creation_ability], placement, *args, **kwargs)
def attack(self, *args, **kwargs):
return self(AbilityId.ATTACK, *args, **kwargs)
def gather(self, *args, **kwargs):
return self(AbilityId.HARVEST_GATHER, *args, **kwargs)
def return_resource(self, *args, **kwargs):
return self(AbilityId.HARVEST_RETURN, *args, **kwargs)
def move(self, *args, **kwargs):
return self(AbilityId.MOVE, *args, **kwargs)
def hold_position(self, *args, **kwargs):
return self(AbilityId.HOLDPOSITION, *args, **kwargs)
def stop(self, *args, **kwargs):
return self(AbilityId.STOP, *args, **kwargs)
def __call__(self, ability, *args, **kwargs):
return unit_command.UnitCommand(ability, self, *args, **kwargs)
def __repr__(self):
return f"Unit(name={self.name !r}, tag={self.tag})"
class UnitOrder(object):
@classmethod
def from_proto(cls, proto, game_data):
return cls(
game_data.abilities[proto.ability_id],
(proto.target_world_space_pos
if proto.HasField("target_world_space_pos") else
proto.target_unit_tag),
proto.progress
)
def __init__(self, ability, target, progress=None):
self.ability = ability
self.target = target
self.progress = progress
def __repr__(self):
return f"UnitOrder({self.ability}, {self.target}, {self.progress})"
| 25.587755 | 92 | 0.657043 | 785 | 6,269 | 5.016561 | 0.175796 | 0.114271 | 0.117318 | 0.130269 | 0.306247 | 0.17293 | 0.094718 | 0.053581 | 0.053581 | 0.042661 | 0 | 0.003796 | 0.24358 | 6,269 | 244 | 93 | 25.692623 | 0.826655 | 0.011964 | 0 | 0.248619 | 0 | 0 | 0.019424 | 0.007608 | 0 | 0 | 0 | 0 | 0.016575 | 1 | 0.320442 | false | 0 | 0.044199 | 0.281768 | 0.685083 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
731146ebb3c25c5a3845856b560730aaae3c8a9f | 117 | py | Python | xpath/sample19.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | null | null | null | xpath/sample19.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | 3 | 2021-09-08T01:11:16.000Z | 2022-03-02T15:14:03.000Z | xpath/sample19.py | silianpan/seal-spider-demo | 23bf013d08f9edaf23823bc3787f579bccd0ec3a | [
"Apache-2.0"
] | 1 | 2019-08-04T09:57:29.000Z | 2019-08-04T09:57:29.000Z | from lxml import etree
html = etree.parse('./test.html', etree.HTMLParser())
result = html.xpath('//*')
print(result) | 29.25 | 53 | 0.700855 | 16 | 117 | 5.125 | 0.6875 | 0.219512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094017 | 117 | 4 | 54 | 29.25 | 0.773585 | 0 | 0 | 0 | 0 | 0 | 0.118644 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7312d83240813de96f32907faf63ccd56923744b | 226 | py | Python | ex048.py | bruceewmesmo/python-mundo-02 | d37d6271f3870f16521391bd7884b57aaae3484a | [
"MIT"
] | null | null | null | ex048.py | bruceewmesmo/python-mundo-02 | d37d6271f3870f16521391bd7884b57aaae3484a | [
"MIT"
] | null | null | null | ex048.py | bruceewmesmo/python-mundo-02 | d37d6271f3870f16521391bd7884b57aaae3484a | [
"MIT"
] | null | null | null |
# EXERCICIO 048 - SOMA IMPARES MULTIPLOS DE 3
soma = 0
cont = 0
for cont in range(1,501,2):
if cont % 3 == 0:
cont += 1
soma += cont
print('A soma dos {} impares multiplos de 3 é {}'.format(cont,soma))
| 17.384615 | 68 | 0.584071 | 38 | 226 | 3.473684 | 0.552632 | 0.242424 | 0.272727 | 0.287879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093168 | 0.287611 | 226 | 12 | 69 | 18.833333 | 0.726708 | 0.190265 | 0 | 0 | 0 | 0 | 0.227778 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7326d7b3f596d9e3e2b2de3c4a9e0722bfee54e7 | 1,243 | py | Python | python-annotator/RenderableCloud.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | python-annotator/RenderableCloud.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | python-annotator/RenderableCloud.py | bubble-07/AnimeReal | b12193f10d231ee85a2a86ec2defeca0b5a4e240 | [
"BSD-2-Clause"
] | null | null | null | from OpenGL.GL import *
from OpenGL.GLUT import *
class RenderableCloud:
#An OpenGL display list generated from a point cloud
#TODO Camera identifiers here?
def __init__(self, pointcloud):
#To generate from a point cloud, we start building a display list
self.dlist_ind = glGenLists(1)
if not self.dlist_ind:
print "Unable to create display list!"
print glGetError()
glColor3f(1, 1, 1)
glNewList(self.dlist_ind, GL_COMPILE)
glPointSize(2.0)
#TODO: Okay to set point size outside of here?
#Also okay to do this with transformations?
glBegin(GL_POINTS)
for point, color in pointcloud.pointIterator():
x, y, z = point
r, g, b, a = color
r, g, b = (float(r) / 255.0, float(g) / 255.0, float(b) / 255.0)
glColor3f(r, g, b)
glVertex3f(x, y, z)
glEnd()
glEndList()
def draw(self, alpha):
glColor4f(1, 1, 1, alpha)
glCallList(self.dlist_ind)
#You MUST call cleanup() before these objects are gc'ed,
#and may not use them to render after you call this
def cleanup(self):
glDeleteLists(self.dlist_ind, 1)
| 27.622222 | 76 | 0.595334 | 171 | 1,243 | 4.263158 | 0.532164 | 0.061728 | 0.082305 | 0.041152 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030552 | 0.315366 | 1,243 | 44 | 77 | 28.25 | 0.826087 | 0.270314 | 0 | 0 | 1 | 0 | 0.03337 | 0 | 0 | 0 | 0 | 0.022727 | 0 | 0 | null | null | 0 | 0.08 | null | null | 0.08 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7329797b00a4f328c31497b3ddbed7ee5def4da9 | 54 | py | Python | Taekwon/Python/greedy/traveler.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | 2 | 2021-09-27T19:10:36.000Z | 2021-11-09T05:40:39.000Z | Taekwon/Python/greedy/traveler.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | 1 | 2021-11-15T14:56:54.000Z | 2021-11-15T14:56:54.000Z | Taekwon/Python/greedy/traveler.py | sonnysorry/codingtest | 478e0168e3209eb97b6b16910027bf12ccc3ccd0 | [
"MIT"
] | null | null | null | n = input()
people = []
for i in range(n):
a =
| 7.714286 | 18 | 0.462963 | 9 | 54 | 2.777778 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.351852 | 54 | 6 | 19 | 9 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
732b341de7a6709abc13af78ce6ec2d7589d325b | 560 | py | Python | chado/client.py | DivSeek-Canada/python-chado | 68648a10fcf26b73cf05e9a403c67e48e6b2f66f | [
"MIT"
] | null | null | null | chado/client.py | DivSeek-Canada/python-chado | 68648a10fcf26b73cf05e9a403c67e48e6b2f66f | [
"MIT"
] | null | null | null | chado/client.py | DivSeek-Canada/python-chado | 68648a10fcf26b73cf05e9a403c67e48e6b2f66f | [
"MIT"
] | 1 | 2021-05-02T14:49:57.000Z | 2021-05-02T14:49:57.000Z | """Base chado client
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
class Client(object):
"""
Base client class implementing methods to make queries to the server
"""
def __init__(self, engine, metadata, session, ci):
self.engine = engine
self.metadata = metadata
self.session = session
self.ci = ci
self.model = ci.model
| 23.333333 | 72 | 0.717857 | 68 | 560 | 5.529412 | 0.485294 | 0.132979 | 0.212766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217857 | 560 | 23 | 73 | 24.347826 | 0.858447 | 0.153571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.076923 | false | 0 | 0.384615 | 0 | 0.538462 | 0.076923 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
734a573b081541b97ffe7cbc1f6e66f43d3aaca1 | 329 | py | Python | app/schemas/token.py | cPoolChia/ChiaAutoplotter-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | 7 | 2021-06-01T09:20:34.000Z | 2021-10-12T07:24:04.000Z | app/schemas/token.py | cPoolChia/ChiaAutoplotter-Worker | 7368396bda018a5adedef74173aba7b6f8f0eccc | [
"MIT"
] | null | null | null | app/schemas/token.py | cPoolChia/ChiaAutoplotter-Worker | 7368396bda018a5adedef74173aba7b6f8f0eccc | [
"MIT"
] | 1 | 2021-05-31T13:08:14.000Z | 2021-05-31T13:08:14.000Z | from datetime import datetime
from typing import Optional, Pattern, Annotated
from uuid import UUID
from pydantic import BaseModel, Field, EmailStr
class Token(BaseModel):
access_token: str
token_type: str
class BaseTokenPayload(BaseModel):
exp: datetime
class AuthTokenPayload(BaseTokenPayload):
sub: UUID | 18.277778 | 47 | 0.778116 | 39 | 329 | 6.512821 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170213 | 329 | 18 | 48 | 18.277778 | 0.930403 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.363636 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
734ef1758100212bee945e930a152cbf21ae9856 | 112 | py | Python | raspberry/back.py | todsy95/Arduino_BT_Android | e9db1577567b3097b432c120c7a01424baa30951 | [
"Apache-2.0"
] | 1 | 2016-12-11T00:19:45.000Z | 2016-12-11T00:19:45.000Z | raspberry/back.py | todsy95/Arduino_BT_Android | e9db1577567b3097b432c120c7a01424baa30951 | [
"Apache-2.0"
] | null | null | null | raspberry/back.py | todsy95/Arduino_BT_Android | e9db1577567b3097b432c120c7a01424baa30951 | [
"Apache-2.0"
] | null | null | null | import serial
port = "/dev/rfcomm0"
back = "5"
ser = serial.Serial(port,9600)
ser.write(back)
ser.flushInput()
| 14 | 30 | 0.705357 | 17 | 112 | 4.647059 | 0.647059 | 0.253165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061224 | 0.125 | 112 | 7 | 31 | 16 | 0.744898 | 0 | 0 | 0 | 0 | 0 | 0.116071 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b41eb08c56a5ca9620158295314effcf7af1fa83 | 144 | py | Python | djfilters/__init__.py | mhsiddiqui/dj-rest-filters | 0b3c2b6afff67d7707c7c04175bee1c43478b4f9 | [
"MIT"
] | null | null | null | djfilters/__init__.py | mhsiddiqui/dj-rest-filters | 0b3c2b6afff67d7707c7c04175bee1c43478b4f9 | [
"MIT"
] | null | null | null | djfilters/__init__.py | mhsiddiqui/dj-rest-filters | 0b3c2b6afff67d7707c7c04175bee1c43478b4f9 | [
"MIT"
] | null | null | null | import django
__version__ = '1.0.0'
if django.VERSION < (3, 2): # pragma: no cover
default_app_config = 'djfilters.apps.DjfiltersConfig'
| 20.571429 | 57 | 0.708333 | 20 | 144 | 4.8 | 0.85 | 0.270833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.166667 | 144 | 6 | 58 | 24 | 0.758333 | 0.111111 | 0 | 0 | 0 | 0 | 0.277778 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b42f6926ac454f8a5a393cb7592cda021354aa68 | 1,107 | py | Python | tests/pbraiders/pages/options/users/actions/create.py | pbraiders/pomponne-test-bdd | 7f2973936318221f54e65e0f8bd839cad7216fa4 | [
"MIT"
] | 1 | 2021-03-30T14:41:29.000Z | 2021-03-30T14:41:29.000Z | tests/pbraiders/pages/options/users/actions/create.py | pbraiders/pomponne-test-bdd | 7f2973936318221f54e65e0f8bd839cad7216fa4 | [
"MIT"
] | null | null | null | tests/pbraiders/pages/options/users/actions/create.py | pbraiders/pomponne-test-bdd | 7f2973936318221f54e65e0f8bd839cad7216fa4 | [
"MIT"
] | null | null | null | # coding=utf-8
"""User page - creation responsability."""
from __future__ import annotations
from pbraiders.pages.options.users.actions import UserActionAbstract
BUTTON_SEND = 'new'
FAILURE_MESSAGE = "Le nom d\'utilisateur ou les mots de passe que vous avez saisis sont incorrects."
EXIST_MESSAGE = 'Cet utilisateur existe déjà.'
SUCCESS_MESSAGE = "Enregistrement réussi."
class CreateUserAction(UserActionAbstract):
"""User page - creation responsability."""
def click(self) -> None:
"""Clicks the button"""
self.page.find_by_name(BUTTON_SEND).first.click()
def has_failed(self) -> bool:
"""Test if the new user creation has failed"""
return self.page.is_text_present(FAILURE_MESSAGE, wait_time=1)
def has_failed_exist(self) -> bool:
"""Test if the new user creation has failed because he's already exist"""
return self.page.is_text_present(EXIST_MESSAGE, wait_time=1)
def has_succeeded(self) -> bool:
"""Test if the new user creation has succeded"""
return self.page.is_text_present(SUCCESS_MESSAGE, wait_time=1)
| 35.709677 | 100 | 0.71635 | 150 | 1,107 | 5.106667 | 0.493333 | 0.041775 | 0.046997 | 0.05483 | 0.315927 | 0.315927 | 0.152742 | 0.152742 | 0.152742 | 0.10705 | 0 | 0.00441 | 0.180668 | 1,107 | 30 | 101 | 36.9 | 0.840132 | 0.232159 | 0 | 0 | 0 | 0 | 0.162393 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0.066667 | 0.133333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
b4377613968b109090e3d492ac311e82bf883568 | 807 | py | Python | tests/realestatelisting_test.py | aaronogan/house-hunt | 89ae7e5f594e1713be67549c1fc5340522e2a85a | [
"MIT"
] | null | null | null | tests/realestatelisting_test.py | aaronogan/house-hunt | 89ae7e5f594e1713be67549c1fc5340522e2a85a | [
"MIT"
] | 1 | 2021-03-27T15:02:30.000Z | 2021-03-27T15:02:30.000Z | tests/realestatelisting_test.py | aaronogan/house-hunt | 89ae7e5f594e1713be67549c1fc5340522e2a85a | [
"MIT"
] | null | null | null | from model.realestatelisting import RealEstateListing
data = {
"list_date": "2020-10-24T023:01:38Z",
"list_price": 230000,
"listing_id": "1212",
"property_id": "1234",
"status": "for_sale",
}
def test_parse_list_date():
listing = RealEstateListing(data)
assert data['list_date'] == listing.list_date
def test_parse_list_price():
listing = RealEstateListing(data)
assert data['list_price'] == listing.list_price
def test_parse_listing_id():
listing = RealEstateListing(data)
assert data['listing_id'] == listing.listing_id
def test_parse_property_id():
listing = RealEstateListing(data)
assert data['property_id'] == listing.property_id
def test_parse_status():
listing = RealEstateListing(data)
assert data['status'] == listing.status
| 22.416667 | 53 | 0.707559 | 97 | 807 | 5.608247 | 0.268041 | 0.231618 | 0.110294 | 0.3125 | 0.371324 | 0.301471 | 0 | 0 | 0 | 0 | 0 | 0.043155 | 0.167286 | 807 | 35 | 54 | 23.057143 | 0.766369 | 0 | 0 | 0.217391 | 0 | 0 | 0.16005 | 0.026055 | 0 | 0 | 0 | 0 | 0.217391 | 1 | 0.217391 | false | 0 | 0.043478 | 0 | 0.26087 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b4476fe54a9a4a38976b929a021bb71dfb5d8394 | 245 | py | Python | gp_mpc/__init__.py | DiegoAE/GP-MPC | 0d629b30eb8641221009e28e8591eb7c7f416e10 | [
"MIT"
] | 93 | 2018-03-16T15:24:19.000Z | 2022-03-23T12:13:52.000Z | gp_mpc/__init__.py | DiegoAE/GP-MPC | 0d629b30eb8641221009e28e8591eb7c7f416e10 | [
"MIT"
] | 6 | 2019-04-17T18:15:00.000Z | 2021-01-12T12:13:14.000Z | gp_mpc/__init__.py | DiegoAE/GP-MPC | 0d629b30eb8641221009e28e8591eb7c7f416e10 | [
"MIT"
] | 32 | 2019-04-12T14:38:54.000Z | 2022-02-25T18:18:30.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from . import gp_functions
from . import optimize
from .gp_class import GP
from .mpc_class import MPC, lqr, plot_eig
from .model_class import Model | 22.272727 | 41 | 0.783673 | 37 | 245 | 4.810811 | 0.459459 | 0.185393 | 0.179775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004808 | 0.15102 | 245 | 11 | 42 | 22.272727 | 0.850962 | 0.085714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
b4499bbdf9038d37e40233ef147f53896b4cce72 | 657 | py | Python | leetcode/remove-outermost-parentheses.py | hg-pyun/algorithm | cf92483c399f05e488b6febc79c80620f115fadf | [
"MIT"
] | 7 | 2018-09-15T13:57:37.000Z | 2022-03-13T10:01:56.000Z | leetcode/remove-outermost-parentheses.py | hg-pyun/algorithm | cf92483c399f05e488b6febc79c80620f115fadf | [
"MIT"
] | 1 | 2019-04-26T07:02:28.000Z | 2019-04-26T07:02:28.000Z | leetcode/remove-outermost-parentheses.py | hg-pyun/algorithm | cf92483c399f05e488b6febc79c80620f115fadf | [
"MIT"
] | 1 | 2020-05-03T23:43:38.000Z | 2020-05-03T23:43:38.000Z | class Solution:
def removeOuterParentheses(self, S: str) -> str:
stack = []
is_assemble = False
assembler = ""
result = ""
for p in S:
if p == "(":
if is_assemble:
assembler += p
if not stack:
is_assemble = True
stack.append(p)
else:
stack.pop()
if not stack:
result += assembler
assembler = ""
is_assemble = False
if is_assemble:
assembler += p
return result
| 27.375 | 52 | 0.383562 | 53 | 657 | 4.660377 | 0.433962 | 0.202429 | 0.121457 | 0.17004 | 0.178138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.544901 | 657 | 23 | 53 | 28.565217 | 0.826087 | 0 | 0 | 0.454545 | 0 | 0 | 0.001522 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.045455 | false | 0 | 0 | 0 | 0.136364 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b456e8174dd154e1d5e46175dab07cdf95ae06a1 | 407 | py | Python | benchmarks.py | smkalami/ypde | 0b4fe1f0cc6d7640c3a7c66ee8f1dab020b220f7 | [
"MIT"
] | 5 | 2019-05-05T10:06:21.000Z | 2021-03-02T10:04:49.000Z | benchmarks.py | smkalami/ypde | 0b4fe1f0cc6d7640c3a7c66ee8f1dab020b220f7 | [
"MIT"
] | 1 | 2018-08-20T16:58:50.000Z | 2018-08-20T16:58:50.000Z | benchmarks.py | smkalami/ypde | 0b4fe1f0cc6d7640c3a7c66ee8f1dab020b220f7 | [
"MIT"
] | 1 | 2021-06-12T12:56:23.000Z | 2021-06-12T12:56:23.000Z | import numpy as np
# Sphere
def sphere(x):
return sum(x**2)
# Rastrigin
def rastrigin(x):
A = 10
n = x.size
return A*n + sum(x**2 - A*np.cos(2*np.pi*x))
# Rosenbrock
def rosenbrock(x):
return sum(100*(x[1:] - x[:-1]**2)**2 + (1-x[:-1])**2)
# Ackley
def ackley(x):
a = 20
b = 0.2
c = 2*np.pi
return a + np.e - a*np.exp(-b*np.mean(x**2)) - np.exp(np.mean(np.cos(c*x)))
| 17.695652 | 79 | 0.528256 | 84 | 407 | 2.559524 | 0.333333 | 0.027907 | 0.093023 | 0.037209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067742 | 0.238329 | 407 | 22 | 80 | 18.5 | 0.625806 | 0.083538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.142857 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b4772eb3eb7dacef78d599323f33eb2894135eef | 157 | py | Python | main.py | zyeinn/PI_Trabalho1 | 6ab424d481122d0b732d59c2b9e0a7c3c3153e8c | [
"MIT"
] | null | null | null | main.py | zyeinn/PI_Trabalho1 | 6ab424d481122d0b732d59c2b9e0a7c3c3153e8c | [
"MIT"
] | null | null | null | main.py | zyeinn/PI_Trabalho1 | 6ab424d481122d0b732d59c2b9e0a7c3c3153e8c | [
"MIT"
] | null | null | null | from functions import *
# Apresenta menus infinitamente até o utilizador pretender
while True:
contacto.show_contacts()
controlMenu(menu()) | 26.166667 | 59 | 0.726115 | 17 | 157 | 6.647059 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210191 | 157 | 6 | 60 | 26.166667 | 0.91129 | 0.356688 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b47e26e93b224e4a4c607aa4cc70bb90a03e0eda | 325 | py | Python | test/test_T.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | 1 | 2022-03-14T07:35:13.000Z | 2022-03-14T07:35:13.000Z | test/test_T.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | 3 | 2022-03-24T02:30:18.000Z | 2022-03-31T07:46:04.000Z | test/test_T.py | zydmayday/pamda | 6740d0294f3bedbeeef3bbc3042a43dceb3239b2 | [
"MIT"
] | null | null | null |
import unittest
import ramda as R
"""
https://github.com/ramda/ramda/blob/master/test/T.js
"""
class TestT(unittest.TestCase):
def test_always_returns_true(self):
self.assertEqual(True, R.T())
self.assertEqual(True, R.T(10))
self.assertEqual(True, R.T(True))
if __name__ == '__main__':
unittest.main()
| 16.25 | 52 | 0.692308 | 48 | 325 | 4.458333 | 0.541667 | 0.21028 | 0.266355 | 0.280374 | 0.294393 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007194 | 0.144615 | 325 | 19 | 53 | 17.105263 | 0.76259 | 0 | 0 | 0 | 0 | 0 | 0.030303 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0.111111 | false | 0 | 0.222222 | 0 | 0.444444 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
81eaa1700e09931237a1e4a3b98928349c41d470 | 154 | py | Python | source-code-from-author-book/Listings-for-Second-Edition/listing_6_13.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | source-code-from-author-book/Listings-for-Second-Edition/listing_6_13.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | source-code-from-author-book/Listings-for-Second-Edition/listing_6_13.py | robrac/algorithms-exercises-with-python | 5780171517eacc1c7133fdc32cf079623cd14cf9 | [
"MIT"
] | null | null | null | def postorder(tree):
if tree != None:
postorder(tree.getLeftChild())
postorder(tree.getRightChild())
print(tree.getRootVal())
| 25.666667 | 39 | 0.623377 | 15 | 154 | 6.4 | 0.6 | 0.40625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.24026 | 154 | 5 | 40 | 30.8 | 0.820513 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.2 | 0.2 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
81fd84747bcdcbc9f5be75607d9eb15145bd232c | 2,385 | py | Python | copper_sdk/copper.py | deanmalmgren/copper-sdk | fd1698529c01ef799ac5dd080e979098d9754e76 | [
"MIT"
] | null | null | null | copper_sdk/copper.py | deanmalmgren/copper-sdk | fd1698529c01ef799ac5dd080e979098d9754e76 | [
"MIT"
] | null | null | null | copper_sdk/copper.py | deanmalmgren/copper-sdk | fd1698529c01ef799ac5dd080e979098d9754e76 | [
"MIT"
] | null | null | null | import requests, json
from .users import Users
from .leads import Leads
from .activities import Activities
from .companies import Companies
from .people import People
from .opportunities import Opportunities
from .customer_sources import CustomerSources
from .loss_reasons import LossReasons
from .custom_field_definitions import CustomFieldDefinitions
class Copper():
# Constructor - authentication details
def __init__(self, token, email, base_url = 'https://api.prosperworks.com/developer_api/v1', debug = False, session = None):
self.token = token
self.email = email
self.base_url = base_url
self.debug = debug
# init request
if not session:
session = requests.Session()
self.session = session
self.session.headers = {}
self.session.headers['X-PW-AccessToken'] = self.token
self.session.headers['X-PW-Application'] = 'developer_api'
self.session.headers['X-PW-UserEmail'] = self.email
self.session.headers['Content-Type'] = 'application/json'
def get(self, endpoint):
return self.api_call('get', endpoint)
def post(self, endpoint, opts):
return self.api_call('post', endpoint, opts)
def put(self, endpoint, opts):
return self.api_call('put', endpoint, opts)
def delete(self, endpoint):
return self.api_call('delete', endpoint)
def api_call(self, method, endpoint, opts = None):
optsJson = None
if opts:
optsJson = json.dumps(opts)
if self.debug:
print(optsJson)
# dynamically call method to handle status change
response = getattr(self.session, method)(self.base_url + endpoint, data=optsJson)
if self.debug:
print(response.text)
return json.loads(response.text)
def users(self):
return Users(self)
def leads(self):
return Leads(self)
def activities(self):
return Activities(self)
def opportunities(self):
return Opportunities(self)
def people(self):
return People(self)
def companies(self):
return Companies(self)
def customersources(self):
return CustomerSources(self)
def lossreasons(self):
return LossReasons(self)
def customfielddefinitions(self):
return CustomFieldDefinitions(self)
| 28.392857 | 128 | 0.657442 | 273 | 2,385 | 5.673993 | 0.274725 | 0.058102 | 0.058102 | 0.043899 | 0.120723 | 0.080052 | 0.042608 | 0 | 0 | 0 | 0 | 0.000558 | 0.248218 | 2,385 | 83 | 129 | 28.73494 | 0.863358 | 0.040671 | 0 | 0.033333 | 0 | 0 | 0.064799 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.166667 | 0.216667 | 0.666667 | 0.033333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c3062d21b5eb69ae4a8f28938f0fe5f9c98c42ac | 719 | py | Python | web/index.py | powersaver2016/powersaver_web | 36c52b24f0dd72c2a6a1145f2749d10772c9b8e3 | [
"MIT"
] | 1 | 2016-09-29T01:01:23.000Z | 2016-09-29T01:01:23.000Z | web/index.py | powersaver2016/powersaver_web | 36c52b24f0dd72c2a6a1145f2749d10772c9b8e3 | [
"MIT"
] | null | null | null | web/index.py | powersaver2016/powersaver_web | 36c52b24f0dd72c2a6a1145f2749d10772c9b8e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
#-*- coding:utf8 -*-
#
# author: shane
import tornado
import pprint
from _module._lib.common import Common
from web._base_ import BaseHandler
class IndexHandler(BaseHandler):
def get(self, *args, **kwargs):
c = self.make_tpl_para()
self.render('index.htm', c=c)
class LoginHandler(BaseHandler):
def get(self, *args, **kwargs):
pass
def post(self, *args, **kwargs):
pass
class LogoutHandler(BaseHandler):
@tornado.web.authenticated
def get(self):
self._session.destroy()
self.redirect(self.get_login_url())
class PageNotFoundHandler(BaseHandler):
def get(self, *args, **kwargs):
self.render('404.htm')
| 18.435897 | 43 | 0.653686 | 88 | 719 | 5.238636 | 0.511364 | 0.052061 | 0.086768 | 0.136659 | 0.201735 | 0.201735 | 0 | 0 | 0 | 0 | 0 | 0.010563 | 0.210014 | 719 | 38 | 44 | 18.921053 | 0.801056 | 0.077886 | 0 | 0.238095 | 0 | 0 | 0.024353 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0.095238 | 0.190476 | 0 | 0.619048 | 0.047619 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
c306e3dbc322c9c71eec861dad9d87d83d484ffe | 104 | py | Python | cooler/_version.py | mimakaev/cooler | 84b0d510dc3baf0b9ef3592f9d27ba795e1802ee | [
"BSD-3-Clause"
] | null | null | null | cooler/_version.py | mimakaev/cooler | 84b0d510dc3baf0b9ef3592f9d27ba795e1802ee | [
"BSD-3-Clause"
] | null | null | null | cooler/_version.py | mimakaev/cooler | 84b0d510dc3baf0b9ef3592f9d27ba795e1802ee | [
"BSD-3-Clause"
] | null | null | null | __version__ = "0.8.10"
__format_version__ = 3
__format_version_mcool__ = 2
__format_version_scool__ = 1
| 20.8 | 28 | 0.807692 | 15 | 104 | 4.2 | 0.666667 | 0.619048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076087 | 0.115385 | 104 | 4 | 29 | 26 | 0.608696 | 0 | 0 | 0 | 0 | 0 | 0.057692 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c31b85b1843a3d1ea88be72583eceb631b0b446a | 122 | py | Python | ch08/hw08_02/hw08_02.py | z2x3c4v5bz/pybook_wenlongtsai_etc | 0a3e90d9f53a1d33e31b27f40de8abdce56e7e2a | [
"MIT"
] | 4 | 2021-06-12T07:51:22.000Z | 2021-12-20T11:35:12.000Z | ch08/hw08_02/hw08_02.py | z2x3c4v5bz/pybook_wenlongtsai_etc | 0a3e90d9f53a1d33e31b27f40de8abdce56e7e2a | [
"MIT"
] | null | null | null | ch08/hw08_02/hw08_02.py | z2x3c4v5bz/pybook_wenlongtsai_etc | 0a3e90d9f53a1d33e31b27f40de8abdce56e7e2a | [
"MIT"
] | 1 | 2021-11-08T03:36:43.000Z | 2021-11-08T03:36:43.000Z | # hw08_02
for i in range(1, 9+1, 2):
print("{:^9}".format("^"*i))
'''
^
^^^
^^^^^
^^^^^^^
^^^^^^^^^
''' | 8.133333 | 32 | 0.286885 | 14 | 122 | 2.428571 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.102273 | 0.278689 | 122 | 15 | 33 | 8.133333 | 0.284091 | 0.057377 | 0 | 0 | 0 | 0 | 0.092308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
c3231a37b47d48cecba682df8882e971f5c93591 | 788 | py | Python | textformat.py | ouka2201/discordpy-startup | 1b170123577f0b6e3db41bb4fbc5838bc3099522 | [
"MIT"
] | null | null | null | textformat.py | ouka2201/discordpy-startup | 1b170123577f0b6e3db41bb4fbc5838bc3099522 | [
"MIT"
] | null | null | null | textformat.py | ouka2201/discordpy-startup | 1b170123577f0b6e3db41bb4fbc5838bc3099522 | [
"MIT"
] | null | null | null | import re
import emoji
def format_text(text):
text = re.sub(r'https?://[\w/:%#\$&\?\(\)~\.=\+\-…]+', "", text)
text = re.sub(r'<:[a-zA-Z0-9_]+:[0-9]+>', "", text)
text = re.sub(r'<@![0-9]+>', "", text)
text = re.sub('RT', "", text)
text = re.sub('お気に入り', "", text)
text = re.sub('まとめ', "", text)
text = re.sub('\n', " ", text)#改行文字
text = re.sub('ぁ', "あ", text)
text = re.sub('ぃ', "い", text)
text = re.sub('ぅ', "う", text)
text = re.sub('ぇ', "え", text)
text = re.sub('ぉ', "お", text)
text = re.sub('ーー*', "ー", text)
text = re.sub('-e', "", text)
text = re.sub('-c', "", text)
text = re.sub('-k', "", text)
text_without_emoji = ''.join(['' if c in emoji.UNICODE_EMOJI else c for c in text])
return text_without_emoji
| 32.833333 | 87 | 0.482234 | 126 | 788 | 2.984127 | 0.349206 | 0.361702 | 0.382979 | 0.518617 | 0.156915 | 0.079787 | 0 | 0 | 0 | 0 | 0 | 0.009804 | 0.22335 | 788 | 23 | 88 | 34.26087 | 0.599673 | 0.005076 | 0 | 0 | 0 | 0 | 0.130268 | 0.075351 | 0 | 0 | 0 | 0 | 0 | 1 | 0.047619 | false | 0 | 0.095238 | 0 | 0.190476 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c32998471406072547f07a42739a732160fc3d54 | 1,567 | py | Python | formatting.py | develop-edu/python | d49d3c315d14d785e10b542ed081fb03afa006a1 | [
"MIT"
] | null | null | null | formatting.py | develop-edu/python | d49d3c315d14d785e10b542ed081fb03afa006a1 | [
"MIT"
] | null | null | null | formatting.py | develop-edu/python | d49d3c315d14d785e10b542ed081fb03afa006a1 | [
"MIT"
] | null | null | null | a = 5
b = 3
c = 72
d = 304
s1 = 'string'
pi = 3.141592
print('{0:-^48}'.format(' % 사용 '))
print('%d + %d = %d' % (a, b, a + b))
print('%d + %d = %d' % (c, d, c + d))
print('*' * 16)
print('%2d + %2d = %2d' % (a, b, a + b))
print('%2d + %2d = %2d' % (c, d, c + d))
print('*' * 16)
print('%03d + %03d = %03d' % (a, b, a + b))
print('%03d + %03d = %03d' % (c, d, c + d))
print('*' * 16)
print('string: %s' % s1)
print('string: [%10s]' % s1)
print('string: [%-10s]' % s1)
print('*' * 16)
print('pi = %f' % pi)
print('pi = %.3f' % pi)
print('pi = %10.3f' % pi)
print('%d = 0x%04X' % (d, d))
print()
print('{0:-^48}'.format(' Use format() '))
print('{0} + {1} = {2}'.format(a, b, a + b))
print('{0} + {1} = {2}'.format(c, d, c + d))
print('*' * 16)
print('{0:2} + {1:2} = {2:2}'.format(a, b, a + b))
print('{0:2} + {1:2} = {2:2}'.format(c, d, c + d))
print('*' * 16)
print('{0:03} + {1:03} = {2:03}'.format(a, b, a + b))
print('{0:03} + {1:03} = {2:03}'.format(c, d, c + d))
print()
print('{0:-^48}'.format(' Use f formatting '))
print(f'{a} + {b} = {a + b}')
print(f'{c} + {d} = {c + d}')
print('*' * 16)
print(f'{a:2} + {b:2} = {a + b:2}')
print(f'{c:2} + {d:2} = {c + d:2}')
print('*' * 16)
print(f'{a:03} + {b:03} = {a + b:03}')
print(f'{c:03} + {d:03} = {c + d:03}')
print('*' * 16)
print(f'string: {s1}')
print(f'string: {s1:<10}')
print(f'string: {s1:>10}')
print('*' * 16)
print(f'pi: {pi}')
print(f'pi: {pi:.3f}')
print(f'pi: {pi:8.3f}')
print(f'pi: {pi:08.3f}')
print('*' * 16)
print(f'{d} = 0x{d:04X}') | 27.017241 | 54 | 0.432036 | 289 | 1,567 | 2.342561 | 0.117647 | 0.047267 | 0.194978 | 0.041359 | 0.592319 | 0.468242 | 0.351551 | 0.183161 | 0.070901 | 0.070901 | 0 | 0.120325 | 0.215061 | 1,567 | 58 | 55 | 27.017241 | 0.430081 | 0 | 0 | 0.236364 | 0 | 0 | 0.407677 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.890909 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
c359453bc4407220df8d33e4bc05023de9bf0094 | 253 | py | Python | app/variables.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | app/variables.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | app/variables.py | tlwr/notifications-api | 88a6b7729edb9be41ce3e7c027f1452b7b6d00d2 | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | # all jobs for letters created via the api must have this filename
LETTER_API_FILENAME = 'letter submitted via api'
LETTER_TEST_API_FILENAME = 'test letter submitted via api'
# S3 tags
class Retention:
KEY = 'retention'
ONE_WEEK = 'ONE_WEEK'
| 23 | 66 | 0.750988 | 38 | 253 | 4.815789 | 0.578947 | 0.153005 | 0.196721 | 0.229508 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004878 | 0.189723 | 253 | 10 | 67 | 25.3 | 0.887805 | 0.284585 | 0 | 0 | 0 | 0 | 0.393258 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c35c513aff433d0c689ba25422d9acc6c6f24c2e | 1,030 | py | Python | hydra-configs-torch/hydra_configs/torch/utils/data/dataset.py | LaudateCorpus1/hydra-torch | 0bd477ce14fe31de511004ab745ce4f3b6b2e7a5 | [
"MIT"
] | 149 | 2020-10-14T04:15:09.000Z | 2022-03-31T13:10:47.000Z | hydra-configs-torch/hydra_configs/torch/utils/data/dataset.py | LaudateCorpus1/hydra-torch | 0bd477ce14fe31de511004ab745ce4f3b6b2e7a5 | [
"MIT"
] | 57 | 2020-10-15T17:21:49.000Z | 2022-02-25T18:25:18.000Z | hydra-configs-torch/hydra_configs/torch/utils/data/dataset.py | LaudateCorpus1/hydra-torch | 0bd477ce14fe31de511004ab745ce4f3b6b2e7a5 | [
"MIT"
] | 15 | 2020-10-16T20:32:43.000Z | 2022-02-16T06:41:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# Generated by configen, do not edit.
# See https://github.com/facebookresearch/hydra/tree/main/tools/configen
# fmt: off
# isort:skip_file
# flake8: noqa
from dataclasses import dataclass, field
from omegaconf import MISSING
from typing import Any
@dataclass
class DatasetConf:
_target_: str = "torch.utils.data.dataset.Dataset"
@dataclass
class ChainDatasetConf:
_target_: str = "torch.utils.data.dataset.ChainDataset"
datasets: Any = MISSING
@dataclass
class ConcatDatasetConf:
_target_: str = "torch.utils.data.dataset.ConcatDataset"
datasets: Any = MISSING
@dataclass
class IterableDatasetConf:
_target_: str = "torch.utils.data.dataset.IterableDataset"
@dataclass
class TensorDatasetConf:
_target_: str = "torch.utils.data.dataset.TensorDataset"
tensors: Any = MISSING
@dataclass
class SubsetConf:
_target_: str = "torch.utils.data.dataset.Subset"
dataset: Any = MISSING
indices: Any = MISSING
| 21.914894 | 72 | 0.747573 | 121 | 1,030 | 6.256198 | 0.512397 | 0.110964 | 0.110964 | 0.150594 | 0.322325 | 0.237781 | 0 | 0 | 0 | 0 | 0 | 0.001152 | 0.157282 | 1,030 | 46 | 73 | 22.391304 | 0.870968 | 0.206796 | 0 | 0.307692 | 1 | 0 | 0.266996 | 0.266996 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.115385 | 0 | 0.769231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c3638b1812006f628cb9cbbe2c37003e127cc0d1 | 339 | py | Python | TagScriptEngine/utils.py | Friskytool/TagScript | fa157389e0aa9955e4d8af9a7bb1080525fb8a08 | [
"CC-BY-4.0"
] | null | null | null | TagScriptEngine/utils.py | Friskytool/TagScript | fa157389e0aa9955e4d8af9a7bb1080525fb8a08 | [
"CC-BY-4.0"
] | null | null | null | TagScriptEngine/utils.py | Friskytool/TagScript | fa157389e0aa9955e4d8af9a7bb1080525fb8a08 | [
"CC-BY-4.0"
] | null | null | null | import re
pattern = re.compile(r"(?<!\\)([{():|}])")
def _sub_match(match: re.Match) -> str:
return "\\" + match.group(1)
def escape_content(string: str) -> str:
"""
Escapes given input to avoid tampering with engine/block behavior.
"""
if string is None:
return
return pattern.sub(_sub_match, string)
| 19.941176 | 70 | 0.610619 | 44 | 339 | 4.590909 | 0.636364 | 0.079208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003788 | 0.221239 | 339 | 16 | 71 | 21.1875 | 0.761364 | 0.19469 | 0 | 0 | 0 | 0 | 0.07393 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.125 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c3643ab347a94f59754ed20ab0bf0b709a6e12cb | 1,709 | py | Python | typedb/api/concept/type/entity_type.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 47 | 2019-01-22T19:17:13.000Z | 2021-02-06T15:39:59.000Z | typedb/api/concept/type/entity_type.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 85 | 2019-01-22T14:51:34.000Z | 2021-04-08T15:41:43.000Z | typedb/api/concept/type/entity_type.py | rpatil524/client-python | e8daba79842a81669f4f4c2799bcc8610e610551 | [
"Apache-2.0"
] | 24 | 2019-01-22T13:21:42.000Z | 2021-03-02T18:06:03.000Z | #
# Copyright (C) 2021 Vaticle
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Iterator
from typedb.api.concept.thing.entity import Entity
from typedb.api.concept.type.thing_type import ThingType, RemoteThingType
if TYPE_CHECKING:
from typedb.api.connection.transaction import TypeDBTransaction
class EntityType(ThingType, ABC):
def is_entity_type(self):
return True
@abstractmethod
def as_remote(self, transaction: "TypeDBTransaction") -> "RemoteEntityType":
pass
class RemoteEntityType(RemoteThingType, EntityType, ABC):
@abstractmethod
def create(self) -> "Entity":
pass
@abstractmethod
def get_instances(self) -> Iterator["Entity"]:
pass
@abstractmethod
def get_subtypes(self) -> Iterator[EntityType]:
pass
@abstractmethod
def set_supertype(self, entity_type: EntityType) -> None:
pass
| 29.465517 | 80 | 0.740784 | 220 | 1,709 | 5.709091 | 0.5 | 0.047771 | 0.031051 | 0.025478 | 0.047771 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00576 | 0.187244 | 1,709 | 57 | 81 | 29.982456 | 0.898488 | 0.455822 | 0 | 0.4 | 0 | 0 | 0.049505 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0.2 | 0.2 | 0.04 | 0.56 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.