repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
MCEdit-Unified | MCEdit-Unified-master/albow/tree.py | # -*- coding: utf-8 -*-
#
# tree.py
#
# (c) D.C.-G. 2014
#
# Tree widget for albow
#
from albow.widget import Widget
from albow.menu import Menu
from albow.fields import IntField, FloatField, TextFieldWrapped
from albow.controls import CheckBox, AttrRef, Label, Button
from albow.dialogs import ask, alert, input_text_bu... | 22,270 | 38.840787 | 315 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/resource.py | # -*- coding: utf-8 -*-
#-# Modified by D.C.-G. for translation purpose
import os
import logging
log = logging.getLogger(__name__)
import pygame
from pygame.locals import RLEACCEL
from translate import langPath
optimize_images = True
run_length_encode = False
__curLang = "default"
def getCurLang():
return __c... | 9,587 | 28.411043 | 116 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/extended_widgets.py | # -*- coding: UTF-8 -*-
# extended_widgets.py
# Moved albow related stuff from mceutils.
from controls import ValueDisplay
from dialogs import Dialog
from controls import Button, Label, ValueButton, CheckBox, AttrRef
from widget import Widget
from layout import Column, Row
from translate import _
from menu import Menu
... | 11,659 | 30.945205 | 131 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/grid_view.py | from pygame import Rect
from widget import Widget
class GridView(Widget):
# cell_size (width, height) size of each cell
#
# Abstract methods:
#
# num_rows() --> no. of rows
# num_cols() --> no. of columns
# draw_cell(surface, row, col, rect)
# click_cell(row, col, ... | 1,533 | 27.943396 | 69 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/file_opener.py | #-# This is not an albow component.
#-# It should be moved back to MCEdit root folder, since it does not defines GUI base widgets.
import os
import logging
import panels
import pymclevel
import albow
import mcplatform
from config import config
from albow.translate import _
class FileOpener(albow.Widget):
is_gl_c... | 5,561 | 35.352941 | 125 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/tab_panel.py | # ###############################################################
#
# Albow - Tab Panel
#
################################################################
#-# Modified by D.C.-G. for translation purpose
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from albow import *
from pygame import ... | 7,406 | 31.92 | 87 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/menu_bar.py | #
# Albow - Menu bar
#
from pygame import Rect
from widget import Widget, overridable_property
class MenuBar(Widget):
menus = overridable_property('menus', "List of Menu instances")
def __init__(self, menus=None, width=0, **kwds):
font = self.predict_font(kwds)
height = font.get_linesize()
... | 1,795 | 25.80597 | 67 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/vectors.py | try:
from Numeric import add, subtract, maximum
except ImportError:
import operator
def add(x, y):
return map(operator.add, x, y)
def subtract(x, y):
return map(operator.sub, x, y)
def maximum(*args):
result = args[0]
for x in args[1:]:
result = map(... | 358 | 16.95 | 46 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/translate.py | # -*- encoding: utf_8 -*-
#
# /usr/bin/python
#
# translate.py
#
# (c) D.C.-G. 2014
#
# Translation module for Python 2.7, especialy for Albow 2 and MCEdit 1.8 799
#
#-------------------------------------------------------------------------------
"""This module adds translation functionnalities to Albow.
It looks for ... | 17,130 | 35.84086 | 184 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/utils.py | from pygame import Surface
from pygame.locals import SRCALPHA
def frame_rect(surface, color, rect, thick=1):
o = 1
surface.fill(color, (rect.left + o, rect.top, rect.width - o - o, thick))
surface.fill(color, (rect.left + o, rect.bottom - thick, rect.width - o - o, thick))
surface.fill(color, (rect.le... | 1,500 | 29.02 | 88 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/image_array.py | from pygame import Rect
from albow.resource import get_image
class ImageArray(object):
def __init__(self, image, shape):
self.image = image
self.shape = shape
if isinstance(shape, tuple):
self.nrows, self.ncols = shape
else:
self.nrows = 1
self.n... | 1,292 | 24.86 | 63 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/layout.py | #
# Albow - Layout widgets
#
from pygame import Rect
from widget import Widget
class RowOrColumn(Widget):
_is_gl_container = True
focusable = False
def __init__(self, size, items, kwds):
align = kwds.pop('align', 'c')
self.spacing = spacing = kwds.pop('spacing', 10)
expand = kwds... | 6,663 | 29.429224 | 80 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/menu.py | # ---------------------------------------------------------------------------
#
# Albow - Pull-down or pop-up menu
#
#---------------------------------------------------------------------------
#-# Modified by D.C.-G. for translation purpose
import sys
from root import get_root, get_focus
from dialogs import Dialog
... | 11,860 | 32.600567 | 107 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/shell.py | #
# Albow - Shell
#
from root import RootWidget
#------------------------------------------------------------------------------
class Shell(RootWidget):
def __init__(self, surface, **kwds):
RootWidget.__init__(self, surface, **kwds)
self.current_screen = None
def show_screen(self, new_scree... | 810 | 25.16129 | 79 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/dialogs.py | #-# Modified by D.C.-G. for translation purpose
import textwrap
from pygame import event, key
from pygame.locals import *
from widget import Widget
from controls import Label, Button
from layout import Row, Column
from fields import TextFieldWrapped
from scrollpanel import ScrollPanel
from table_view import TableView, ... | 7,136 | 27.894737 | 265 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/version.py | version = (2, 1, 0)
| 20 | 9.5 | 19 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/scrollpanel.py | # -*- coding: utf_8 -*-
#
# scrollpanel.py
#
# Scrollable widget which contains other widgets, for albow
#
from palette_view import PaletteView
from layout import Column
from utils import blit_in_rect
from pygame import event, Surface, SRCALPHA, Rect, draw, mouse
#------------------------------------------------------... | 12,344 | 34.886628 | 175 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/music.py | # ---------------------------------------------------------------------------
#
# Albow - Music
#
#---------------------------------------------------------------------------
from __future__ import division
import os
from random import randrange
try:
from pygame.mixer import music
except ImportError:
music ... | 6,386 | 28.031818 | 77 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/root.py | # ---------------------------------------------------------------------------
#
# Albow - Root widget
#
#---------------------------------------------------------------------------
import sys
import traceback
import pygame
from pygame import key
from pygame.locals import *
from pygame.event import Event
from glba... | 24,040 | 36.100309 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/openglwidgets.py | # -------------------------------------------------------------------------
#
# Albow - OpenGL widgets
#
#-------------------------------------------------------------------------
from __future__ import division
from OpenGL import GL, GLU
from widget import Widget
class GLViewport(Widget):
is_gl_container = Tr... | 3,169 | 27.558559 | 84 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/sound.py | #
# Albow - Sound utilities
#
import pygame
from pygame import mixer
def pause_sound():
try:
mixer.pause()
except pygame.error:
pass
def resume_sound():
try:
mixer.unpause()
except pygame.error:
pass
def stop_sound():
try:
mixer.stop()
except pygame... | 341 | 11.214286 | 25 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/widget.py | from __future__ import division
import sys
import albow # used for translation update
from pygame import Rect, Surface, image
from pygame.locals import K_RETURN, K_KP_ENTER, K_ESCAPE, K_TAB, KEYDOWN, SRCALPHA
from pygame.mouse import set_cursor
from pygame.cursors import arrow as arrow_cursor
from pygame.transform impo... | 28,228 | 32.969916 | 162 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/screen.py | #
# Albow - Screen
#
from widget import Widget
#------------------------------------------------------------------------------
class Screen(Widget):
def __init__(self, shell, **kwds):
Widget.__init__(self, shell.rect, **kwds)
self.shell = shell
self.center = shell.center
def begin_f... | 429 | 16.916667 | 79 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/__init__.py | """ALBOW - A Little Bit of Widgetry for PyGame
by Gregory Ewing
[email protected]
"""
update_translation = False
# Register unparented widgets in this to track them.
unparented = {}
from version import version
from albow.controls import Label, Button, Image, AttrRef, ItemRef, \
RadioButton, ValueDispl... | 1,438 | 37.891892 | 138 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/table_view.py | #
# Albow - Table View
#
#-# Modified by D.C.-G. for translation purpose
from pygame import Rect
from layout import Column
from palette_view import PaletteView
from utils import blit_in_rect
from translate import _
class TableView(Column):
columns = []
header_font = None
header_fg_color = None
header_... | 5,676 | 30.192308 | 83 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/fields.py | #
# Albow - Fields
#
# - # Modified by D.C.-G. for translation purpose
from pygame import draw
import traceback
import pygame
from pygame import key
# noinspection PyUnresolvedReferences
from pygame.locals import K_LEFT, K_RIGHT, K_TAB, K_c, K_v, K_x, SCRAP_TEXT, K_UP, K_DOWN, K_RALT, K_LALT, \
K_BACKSPACE, K_DELET... | 52,806 | 34.874321 | 246 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/controls.py | #
# Albow - Controls
#
#-# Modified by D.C.-G. for translation purpose
from pygame import Rect, draw, transform
from pygame.locals import K_RETURN, K_KP_ENTER, K_SPACE
from widget import Widget, overridable_property
from theme import ThemeProperty
import resource
from translate import _
class Control(object):
h... | 11,333 | 26.114833 | 117 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/text_screen.py | #
# Albow - Text Screen
#
from pygame.locals import *
from screen import Screen
from theme import FontProperty
from resource import get_text
from vectors import add, maximum
from controls import Button
#------------------------------------------------------------------------------
class Page(object):
def __init... | 3,601 | 31.745455 | 103 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/palette_view.py | from pygame import Rect, draw
from grid_view import GridView
from utils import frame_rect
from theme import ThemeProperty
class PaletteView(GridView):
# nrows int No. of displayed rows
# ncols int No. of displayed columns
#
# Abstract methods:
#
# num_items() --> no. of items
... | 8,223 | 30.875969 | 98 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/ChangeMobs.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import TAG_List
from pymclevel import TAG_Byte
from pymclevel import TAG_Int
from pymclevel import TAG_Float
from pymclevel import TAG_Short
from pymclevel import TAG_... | 4,280 | 33.248 | 137 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/NBTEdit.py | import ast
from pymclevel.box import BoundingBox
inputs = [(("Entities", True),
("TileEntities", True),
("TileTicks", True),
("Options", "title")),
(("Results", "title"),
("", ["NBTTree", {}, 0, False]),
)]
tree = None
chunks = None
boundingBox = None
... | 3,622 | 40.170455 | 239 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/surfacerepair.py | from numpy import zeros, array
import itertools
# naturally occuring materials
from pymclevel.level import extractHeights
blocktypes = [1, 2, 3, 7, 12, 13, 14, 15, 16, 56, 73, 74, 87, 88, 89]
blockmask = zeros((256,), dtype='bool')
#compute a truth table that we can index to find out whether a block
# is naturally o... | 1,963 | 33.45614 | 83 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/mcInterface.py | # dummy mcInterface to adapt dudecon's interface to MCEdit's
class MCLevelAdapter(object):
def __init__(self, level, box):
self.level = level
self.box = box
def check_box_2d(self, x, z):
box = self.box
if x < box.minx or x >= box.maxx:
return False
if z < b... | 1,511 | 25.526316 | 84 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/CreateShops.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
#
''' Fixed for MC 1.8 by Rezzing, September 6, 2014
PLEASE READ: The unusable trade won't prevent new trades anymore but I
solved it by adding a very high career level. So only use ... | 8,945 | 36.120332 | 176 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/Find.py | # written by texelelf
#-# Adding a result pages, and NBT edit stuff
from pymclevel import TAG_Byte, TAG_Short, TAG_Int, TAG_Compound, TAG_List, TAG_String, TAG_Double, TAG_Float, TAG_Long, \
TAG_Byte_Array, TAG_Int_Array
from pymclevel.box import BoundingBox
from albow import alert, ask
import ast
# Let import the ... | 13,288 | 43.89527 | 383 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/topsoil.py | from numpy import zeros
import itertools
from pymclevel import alphaMaterials
from pymclevel.level import extractHeights
am = alphaMaterials
# naturally occuring materials
blocks = [
am.Grass,
am.Dirt,
am.Stone,
am.Bedrock,
am.Sand,
am.Gravel,
am.GoldOre,
am.IronOre,
am.CoalOre,
... | 3,211 | 31.77551 | 83 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/MCEditForester.py | '''MCEditForester.py
Tree-generating script by dudecon
http://www.minecraftforum.net/viewtopic.php?f=1022&t=219461
Needs the dummy mcInterface for MCEdit, and the default Forester script.
'''
from pymclevel.materials import alphaMaterials
import Forester
displayName = "Forester"
libraries = [
... | 3,683 | 28.709677 | 76 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/BanSlimes.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import TAG_Long
# This mimics some of the functionality from the Java Random class.
# Java Random source code can be found here: http://developer.classpath.org/doc/ja... | 1,817 | 26.969231 | 108 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/AddPotionEffect.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import TAG_List
from pymclevel import TAG_Byte
from pymclevel import TAG_Int
from pymclevel import TAG_Compound
displayName = "Add Potion Effect to Mobs"
Effects = {... | 1,879 | 26.246377 | 98 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/floodwater.py | from numpy import *
from pymclevel import alphaMaterials, faceDirections, FaceYIncreasing
from collections import deque
import datetime
displayName = "Classic Water Flood"
inputs = (
(
"Makes water in the region flood outwards and downwards, becoming full source blocks in the process. This is similar to Minecr... | 2,508 | 32.013158 | 150 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/Invincible.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import TAG_List
from pymclevel import TAG_Byte
from pymclevel import TAG_Int
from pymclevel import TAG_Compound
displayName = "Make Mobs Invincible"
def perform(lev... | 1,075 | 33.709677 | 98 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/decliff.py | """
DeCliff filter contributed by Minecraft Forums user "DrRomz"
Originally posted here:
http://www.minecraftforum.net/topic/13807-mcedit-minecraft-world-editor-compatible-with-mc-beta-18/page__st__3940__p__7648793#entry7648793
"""
from numpy import zeros, array
import itertools
from pymclevel import alphaMaterials
a... | 10,724 | 37.16726 | 138 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/CreateBusses.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from numpy import sign
displayName = "Create Busses"
def perform(level, box, options):
level.markDirtyBox(box)
bus = BusCreator(level, box, options)
bus.getTerminals(... | 12,797 | 26.229787 | 105 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/smoothshape.py | # Enlarge Filter by SethBling
# Feel free to modify and reuse, but credit to SethBling would be nice.
# http://youtube.com/sethbling
from numpy import zeros
inputs = (
("Smoothing", (1, 1, 20)),
("Made by Sethbling", "label")
)
displayName = "Smooth - 3D"
def perform(level, box, options):
smoothing = op... | 2,350 | 25.715909 | 76 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/CreateSpawners.py | # Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import TAG_Compound
from pymclevel import TAG_Int
from pymclevel import TAG_Short
from pymclevel import TAG_Byte
from pymclevel import TAG_String
from pymclevel import... | 1,626 | 30.288462 | 98 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/setbiome.py | # SethBling's SetBiome Filter
# Directions: Just select a region and use this filter, it will apply the
# biome to all columns within the selected region. It can be used on regions
# of any size, they need not correspond to chunks.
#
# If you modify and redistribute this code, please credit SethBling
from pymclevel im... | 5,569 | 29.271739 | 114 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/smooth.py | from numpy import zeros, array
import itertools
from pymclevel.level import extractHeights
terrainBlocktypes = [1, 2, 3, 7, 12, 13, 14, 15, 16, 56, 73, 74, 87, 88, 89]
terrainBlockmask = zeros((256,), dtype='bool')
terrainBlockmask[terrainBlocktypes] = True
#
inputs = (
("Repeat count", (1, 50)),
)
displayName =... | 2,281 | 32.072464 | 111 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/Forester.py | # Version 5
'''This takes a base MineCraft level and adds or edits trees.
Place it in the folder where the save files are (usually .../.minecraft/saves)
Requires mcInterface.py in the same folder.'''
# Here are the variables you can edit.
# This is the name of the map to edit.
# Make a backup if you are experimenting... | 51,634 | 37.163341 | 89 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/colorwires.py | def perform(level, box, options):
groups = RedstoneGroups(level)
for x in xrange(box.minx, box.maxx):
for y in xrange(box.miny, box.maxy):
for z in xrange(box.minz, box.maxz):
groups.testblock((x, y, z))
groups.changeBlocks()
TransparentBlocks = [0, 6, 8, 9, 10, 11, 1... | 5,274 | 33.253247 | 120 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/test_.py | from pymclevel.materials import BlockstateAPI
from pymclevel import nbt
import numpy
def perform(level, box, options):
block_api = level.materials.blockstate_api
assert isinstance(block_api, BlockstateAPI)
print block_api.idToBlockstate(251, 1)
root = nbt.TAG_Compound()
data = nbt.TAG_Compound()
... | 509 | 20.25 | 47 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/demo/Test.py | from albow import Widget, Label, Button, TextFieldWrapped
from pymclevel.nbt import *
import release
operations = {
"Yes/No Dialog": 1,
"Custom Dialog": 2,
"Scoreboard Editing (Objective)": 3,
"Scoreboard Editing (Team)": 4,
"Player Data": 5,
}
inputs = (
("Operation", tuple(sorted(operati... | 4,177 | 35.017241 | 92 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-filters/demo/filterdemo.py | # the inputs list tells MCEdit what kind of options to present to the user.
# each item is a (name, value) pair. name is a text string acting
# both as a text label for the input on-screen and a key for the 'options'
# parameter to perform(). value and its type indicate allowable and
# default values for the option:
... | 5,141 | 44.910714 | 87 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Paste.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask
import mcplatform
import pymclevel
from pymclevel import BoundingBox
displayName = 'Schematic'
addPasteButton = True
disableStyleButton = True
def createInputs(self):
self.inputs= (
)
pass
def createDir... | 669 | 20.612903 | 82 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Erode.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask
import numpy
displayName = 'Erode'
def createInputs(self):
self.inputs = (
{'Hollow': False},
{'Noise': 100},
{'W': (3, 1, 4096), 'H': (3, 1, 4096), 'L': (3, 1, 4096)},
{'Strength': (1, 1, 20)},
{'Old (Messy)'... | 2,572 | 31.1625 | 100 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Fill.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask, createTileEntities
import numpy
displayName = 'Fill'
mainBlock = 'Block'
def createInputs(self):
self.inputs = (
{'Hollow': False},
{'Noise': 100},
{'W': (3, 1, 4096), 'H': (3, 1, 4096), 'L': (3, 1, 4096)},
{'Blo... | 1,154 | 29.394737 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Topsoil.py | from editortools.brush import createBrushMask, createTileEntities
from pymclevel.level import extractHeights
import itertools
displayName = "Topsoil"
def createInputs(self):
self.inputs = (
{'Hollow': False},
{'Noise': 100},
{'W': (3, 1, 4096), 'H': (3, 1, 4096), 'L': (3, 1, 4096)},
{'Block': mat... | 2,075 | 29.985075 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Varied Replace.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask, createTileEntities
from albow import alert
from pymclevel import block_fill
import numpy
import random
displayName = "Varied Replace"
mainBlock = "Block 1"
secondaryBlock = "Block"
def createInputs(self):
self.inputs = (
{'H... | 4,708 | 37.284553 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Replace.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask, createTileEntities
from pymclevel import block_fill
displayName = 'Replace'
mainBlock = 'Block To Replace With'
secondaryBlock = 'Block'
wildcardBlocks = ['Block']
def createInputs(self):
self.inputs = (
{'Hollow': False},
... | 1,539 | 33.222222 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Flood Fill.py | from pymclevel.materials import Block
from pymclevel.entity import TileEntity
from editortools.brush import createBrushMask
import numpy
from editortools.operation import mkundotemp
from albow import showProgress
import pymclevel
import datetime
import collections
from pymclevel import BoundingBox
import logging
log = ... | 4,233 | 33.422764 | 117 | py |
MCEdit-Unified | MCEdit-Unified-master/stock-brushes/Varied Fill.py | from pymclevel.materials import Block
from editortools.brush import createBrushMask, createTileEntities
from albow import alert
import numpy
import random
displayName = "Varied Fill"
mainBlock = "Block 1"
secondaryBlock = "Block"
def createInputs(self):
self.inputs = (
{'Hollow': False, 'Noise': 100},
{'... | 4,466 | 37.179487 | 155 | py |
MCEdit-Unified | MCEdit-Unified-master/leveldb_mcpe/test.py | exceptions = 0
from leveldb_mcpe import DB, Options, ReadOptions, WriteOptions, WriteBatch, RepairWrapper
op = Options()
op.create_if_missing = True
wop = WriteOptions()
rop = ReadOptions()
db = DB(op, "test")
db.Put(wop, "1", "5")
db.Put(wop, "2", "6")
if db.Get(rop, "1") != "5":
print "Failed to retrieve correc... | 2,307 | 22.313131 | 107 | py |
MCEdit-Unified | MCEdit-Unified-master/leveldb_mcpe/setup.py | from setuptools import setup
from distutils.extension import Extension
import os.path
import sys
extra_compile_args = ["-DDLLX="]
extra_link_args = []
define_macros = []
runtime_library_dirs = []
library_dirs = []
libraries = []
include_dirs = []
if sys.platform == "win32":
if sys.maxsize > 2 ** 32: # 64-bit
... | 11,573 | 43.860465 | 478 | py |
MCEdit-Unified | MCEdit-Unified-master/leveldb_mcpe/setupnx.py | #!/usr/bin/python2
# -*- coding: utf-8
#
# setupnx.py
#
# Build leveldb-mcpe for MCEdit-unified.
#
# D.C.-G. (LaChal) 2015
#
from setuptools import setup
from distutils.extension import Extension
import os
import sys
import platform
extra_compile_args = ["-DDLLX="]
extra_link_args = []
define_macros = []
runtime_libra... | 14,577 | 37.46438 | 476 | py |
msutils | msutils-master/setup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 SKA South Africa
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | 2,494 | 32.266667 | 71 | py |
msutils | msutils-master/MSUtils/msutils.py | from pyrap.tables import table
import pyrap.tables
import pyrap.measures
import numpy
import traceback
from pyrap.tables import maketabdesc
from pyrap.tables import makearrcoldesc
from pyrap.tables import makescacoldesc
from distutils import spawn
import sys
import subprocess
import math
import json
import codecs
impor... | 13,798 | 32.492718 | 161 | py |
msutils | msutils-master/MSUtils/imp_plotter.py | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from pyrap.tables import table
def plot_bandpass_table(gain_table, plt_scale=6, plt_dpi=600, plot_file=None):
#Reads in the gain table; makes plots of gain amplitude/phase with
#time/frequency for all the antennas.
#Read in th... | 15,561 | 40.388298 | 149 | py |
msutils | msutils-master/MSUtils/flag_stats.py | #from contextlib import ExitStack
import sys
import math
import json
import numpy
import logging
import casacore.measures
from MSUtils import msutils
import dask
import dask.array as da
from daskms import xds_from_ms, xds_to_table, xds_from_table
from bokeh.layouts import row, column
from bokeh.plotting import figu... | 16,577 | 35.676991 | 99 | py |
msutils | msutils-master/MSUtils/__init__.py | from MSUtils import msutils
| 28 | 13.5 | 27 | py |
msutils | msutils-master/MSUtils/ClassESW.py | import matplotlib
matplotlib.use('Agg')
import sys
import os
import numpy
import numpy.ma as ma
import pylab
from scipy.interpolate import interp1d
from scipy import interpolate
from MSUtils import msutils
from pyrap.tables import table
import matplotlib.cm as cm
MEERKAT_SEFD = numpy.array([
[ 856e6, 580.],
[ 900e6... | 7,690 | 36.517073 | 131 | py |
ssci2022 | ssci2022-main/run2.py | from sys import argv
from psb import program_synth as ps
from garch import genome_archive_part as gap
problem, search, npop, ngen, nproc, seed = argv[1:]
garch = gap(["small-or-large/1017.sol", "median/1010.sol"], n_part=5)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
... | 614 | 24.625 | 69 | py |
ssci2022 | ssci2022-main/run3.py | from sys import argv
from pyshgp.gp.genome import Genome, GenomeArchive
from pyshgp.gp.individual import Individual
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
sl = Individual.load("small-or-large/1017.sol").genome
md = Individual.load("median/1010.sol").genome
garch = Geno... | 818 | 26.3 | 54 | py |
ssci2022 | ssci2022-main/psb.py | import string
import numpy as np
import pandas as pd
import time
from pyshgp.gp.estimators import PushEstimator
from pyshgp.gp.genome import GeneSpawner
from pyshgp.push.config import PushConfig
from pyshgp.push.instruction_set import InstructionSet
from pyshgp.push.types import Char, IntVector, FloatVector, StrVector
... | 36,951 | 33.025783 | 211 | py |
ssci2022 | ssci2022-main/run.py | from sys import argv
import numpy as np
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
ngen=int(ngen),
nproc=int(nproc),
s... | 374 | 19.833333 | 51 | py |
ssci2022 | ssci2022-main/garch.py | from typing import Sequence
import numpy as np
from pyshgp.gp.genome import Genome, GenomeArchive
from pyshgp.gp.individual import Individual
def load_genome(path: str) -> Genome:
individual = Individual.load(path)
return individual.genome
def __subgenome(genome: Genome, subgenome_length: int) -> Genome:
... | 2,314 | 28.679487 | 89 | py |
ssci2022 | ssci2022-main/postprocess.py | import pandas as pd
import pickle as pc
from pyshgp.gp.individual import Individual
from pyshgp.gp.genome import GenomeArchive
from sys import argv
from garch import divide_subgenome_part as divide
last_problem = argv[1]
summary = pd.read_csv("summary.csv", header=None)
summary.columns=["prob","seed","err","len"]
su... | 812 | 30.269231 | 82 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run8r.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run6r.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run9r.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run7r.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run5r.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps_r/run4r.py | from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
ngen=int(ngen),
nproc=int(nproc),
seed=int(seed))
... | 551 | 23 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run8.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run4.py | from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
ngen=int(ngen),
nproc=int(nproc),
seed=int(seed))
... | 550 | 24.045455 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run5.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run7.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run6.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/sh/kdps/run9.py | from pickle import load
from sys import argv
from psb import program_synth as ps
problem, search, npop, ngen, nproc, seed = argv[1:]
with open("subprogram.arch", "rb") as f:
garch = load(f)
if __name__ == "__main__":
est = ps(problem=problem,
search=search,
npop=int(npop),
... | 732 | 25.178571 | 59 | py |
ssci2022 | ssci2022-main/arm_data/record.py | import gzip
import pickle
import os
import numpy as np
from utils import get_error, isImprovedByReplacement
"""Record names"""
error_file = "error.csv"
anytime_file = "anytime.csv"
"""Problems, Methods, Seeds"""
problems = [ # Problems and short names
"median"
]
problem_names = [
"MD"
]
methods = [ # Meth... | 3,881 | 37.435644 | 157 | py |
ssci2022 | ssci2022-main/arm_data/utils.py | import numpy as np
def get_error(fname):
"""get train and test error from log file"""
with open(fname, "r") as log_file:
train_flag = False
for line in log_file:
if train_flag:
train_error = float(line.strip())
train_flag = False
if ... | 753 | 29.16 | 75 | py |
skywalking | skywalking-master/test/e2e-v2/cases/browser/docker/test.py | # 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 ... | 1,384 | 31.209302 | 84 | py |
skywalking | skywalking-master/test/e2e-v2/cases/browser/docker/provider.py | #
# 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 us... | 2,028 | 33.982759 | 74 | py |
skywalking | skywalking-master/test/e2e-v2/cases/python/consumer.py | #
# 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 us... | 2,213 | 37.172414 | 79 | py |
skywalking | skywalking-master/test/e2e-v2/cases/python/provider-kafka.py | #
# 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 us... | 1,605 | 32.458333 | 74 | py |
skywalking | skywalking-master/test/e2e-v2/cases/python/provider.py | #
# 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 us... | 1,568 | 32.382979 | 74 | py |
lale | lale-master/setup.py | # Copyright 2019-2023 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 4,556 | 27.304348 | 90 | py |
lale | lale-master/test/test_autoai_output_consumption.py | import os
import re
import sys
import time
import traceback
import unittest
import urllib.request
from typing import Optional
import joblib
import pandas as pd
import sklearn
from sklearn.linear_model import LogisticRegression as LR
from sklearn.neighbors import KNeighborsClassifier as KNN
from sklearn.tree import Dec... | 8,718 | 38.631818 | 164 | py |
lale | lale-master/test/mock_custom_operators.py | # Copyright 2019-2022 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 11,118 | 28.571809 | 94 | py |
lale | lale-master/test/test_custom_schemas.py | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 27,885 | 40.435364 | 88 | py |
lale | lale-master/test/test_relational_from_sklearn_manual.py | # Copyright 2021-2023 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 18,521 | 40.716216 | 150 | py |
lale | lale-master/test/test_lale_lib_versions.py | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 22,044 | 30.856936 | 87 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.